Home | History | Annotate | Download | only in TableGen

Lines Matching refs:intrinsic

1 //===- IntrinsicEmitter.cpp - Generate intrinsic information --------------===//
10 // This tablegen backend emits information about intrinsic functions.
68 emitSourceFileHeader("Intrinsic Function Source Fragment", OS);
80 // Emit the intrinsic ID -> name table.
83 // Emit the intrinsic ID -> overload table.
89 // Emit the intrinsic declaration generator.
92 // Emit the intrinsic parameter attributes.
95 // Emit intrinsic alias analysis mod/ref behavior.
142 // Build a 'first character of function name' -> intrinsic # mapping.
152 // Emit the intrinsic matching stuff by first letter.
158 // Sort in reverse order of intrinsic name so "abc.def" appears after
170 std::string Result = "return " + TargetPrefix + "Intrinsic::" +
197 OS << "// Intrinsic ID to name table\n";
199 OS << " // Note that entry #0 is the invalid intrinsic!\n";
208 OS << "// Intrinsic ID to overload bitset\n";
213 // Add one to the index so we emit a null bit for the invalid #0 intrinsic.
220 // OTable contains a true bit at the position if the intrinsic is overloaded.
272 default: PrintFatalError("unhandled integer type width in intrinsic!");
282 default: PrintFatalError("unhandled MVT in intrinsic!");
368 default: PrintFatalError("unhandled vector type width in intrinsic!");
389 /// intrinsic into 32 bits, return it. If not, return ~0U.
423 // If we can compute a 32-bit fixed encoding for this intrinsic, do so and
433 // Get the signature for the intrinsic.
468 OS << "// Global intrinsic function declaration type table.\n";
511 static ModRefKind getModRefKind(const CodeGenIntrinsic &intrinsic) {
512 switch (intrinsic.ModRef) {
550 /// EmitAttributes - This emits the Intrinsic::getAttributes method.
557 << "Intrinsic::ID id) {\n";
559 OS << "AttributeSet Intrinsic::getAttributes(LLVMContext &C, ID id) {\n";
568 const CodeGenIntrinsic &intrinsic = Ints[i];
570 std::max(maxArgAttrs, unsigned(intrinsic.ArgumentAttributes.size()));
571 unsigned &N = UniqAttributes[&intrinsic];
582 const CodeGenIntrinsic &intrinsic = Ints[i];
584 OS << " " << UniqAttributes[&intrinsic] << ", // "
585 << intrinsic.Name << "\n";
594 OS << "Intrinsic::num_intrinsics";
603 const CodeGenIntrinsic &intrinsic = *(I->first);
609 unsigned ai = 0, ae = intrinsic.ArgumentAttributes.size();
612 unsigned argNo = intrinsic.ArgumentAttributes[ai].first;
618 switch (intrinsic.ArgumentAttributes[ai].second) {
640 } while (ai != ae && intrinsic.ArgumentAttributes[ai].first == argNo);
647 ModRefKind modRef = getModRefKind(intrinsic);
649 if (!intrinsic.canThrow || modRef || intrinsic.isNoReturn ||
650 intrinsic.isNoDuplicate) {
653 if (!intrinsic.canThrow) {
657 if (intrinsic.isNoReturn) {
663 if (intrinsic.isNoDuplicate) {
705 /// EmitModRefBehavior - Determine intrinsic alias analysis mod/ref behavior.
708 OS << "// Determine intrinsic alias analysis mod/ref behavior.\n"
710 << "assert(iid <= Intrinsic::" << Ints.back().EnumName << " && "
711 << "\"Unknown intrinsic.\");\n\n";
751 "return " + TargetPrefix + "Intrinsic::" + I->second + ";";
771 PrintFatalError("Intrinsic '" + Ints[i].TheDef->getName() +
776 OS << "// Get the LLVM intrinsic that corresponds to a GCC builtin.\n";
783 OS << "static " << TargetPrefix << "Intrinsic::ID "
787 OS << "Intrinsic::ID Intrinsic::getIntrinsicForGCCBuiltin(const char "
809 OS << "(" << TargetPrefix << "Intrinsic::ID)";
810 OS << "Intrinsic::not_intrinsic;\n";
820 for (const auto &Intrinsic : Ints) {
821 if (Intrinsic.MSBuiltinName.empty())
824 auto &Builtins = TargetBuiltins[Intrinsic.TargetPrefix];
825 if (!Builtins.insert(std::make_pair(Intrinsic.MSBuiltinName,
826 Intrinsic.EnumName)).second)
827 PrintFatalError("Intrinsic '" + Intrinsic.TheDef->getName() + "': "
831 OS << "// Get the LLVM intrinsic that corresponds to a MS builtin.\n"
837 OS << (TargetOnly ? "static " + TargetPrefix : "") << "Intrinsic::ID "
838 << (TargetOnly ? "" : "Intrinsic::")
857 OS << "(" << TargetPrefix << "Intrinsic::ID)";
858 OS << "Intrinsic::not_intrinsic;\n";