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.
67 emitSourceFileHeader("Intrinsic Function Source Fragment", OS);
79 // Emit the intrinsic ID -> name table.
82 // Emit the intrinsic ID -> overload table.
88 // Emit the intrinsic declaration generator.
91 // Emit the intrinsic parameter attributes.
94 // Emit intrinsic alias analysis mod/ref behavior.
137 // Build a 'first character of function name' -> intrinsic # mapping.
147 // Emit the intrinsic matching stuff by first letter.
159 std::string Result = "return " + TargetPrefix + "Intrinsic::" +
186 OS << "// Intrinsic ID to name table\n";
188 OS << " // Note that entry #0 is the invalid intrinsic!\n";
197 OS << "// Intrinsic ID to overload bitset\n";
202 // Add one to the index so we emit a null bit for the invalid #0 intrinsic.
209 // OTable contains a true bit at the position if the intrinsic is overloaded.
254 default: PrintFatalError("unhandled integer type width in intrinsic!");
264 default: PrintFatalError("unhandled MVT in intrinsic!");
334 default: PrintFatalError("unhandled vector type width in intrinsic!");
354 /// intrinsic into 32 bits, return it. If not, return ~0U.
388 // If we can compute a 32-bit fixed encoding for this intrinsic, do so and
398 // Get the signature for the intrinsic.
433 OS << "// Global intrinsic function declaration type table.\n";
474 static ModRefKind getModRefKind(const CodeGenIntrinsic &intrinsic) {
475 switch (intrinsic.ModRef) {
510 /// EmitAttributes - This emits the Intrinsic::getAttributes method.
517 << "Intrinsic::ID id) {\n";
519 OS << "AttributeSet Intrinsic::getAttributes(LLVMContext &C, ID id) {\n";
528 const CodeGenIntrinsic &intrinsic = Ints[i];
530 std::max(maxArgAttrs, unsigned(intrinsic.ArgumentAttributes.size()));
531 unsigned &N = UniqAttributes[&intrinsic];
542 const CodeGenIntrinsic &intrinsic = Ints[i];
544 OS << " " << UniqAttributes[&intrinsic] << ", // "
545 << intrinsic.Name << "\n";
555 OS << "Intrinsic::num_intrinsics";
564 const CodeGenIntrinsic &intrinsic = *(I->first);
570 unsigned ai = 0, ae = intrinsic.ArgumentAttributes.size();
573 unsigned argNo = intrinsic.ArgumentAttributes[ai].first;
578 switch (intrinsic.ArgumentAttributes[ai].second) {
585 } while (ai != ae && intrinsic.ArgumentAttributes[ai].first == argNo);
592 ModRefKind modRef = getModRefKind(intrinsic);
594 if (!intrinsic.canThrow || modRef || intrinsic.isNoReturn) {
597 if (!intrinsic.canThrow)
599 if (intrinsic.isNoReturn)
631 /// EmitModRefBehavior - Determine intrinsic alias analysis mod/ref behavior.
634 OS << "// Determine intrinsic alias analysis mod/ref behavior.\n"
636 << "assert(iid <= Intrinsic::" << Ints.back().EnumName << " && "
637 << "\"Unknown intrinsic.\");\n\n";
677 "return " + TargetPrefix + "Intrinsic::" + I->second + ";";
697 PrintFatalError("Intrinsic '" + Ints[i].TheDef->getName() +
702 OS << "// Get the LLVM intrinsic that corresponds to a GCC builtin.\n";
709 OS << "static " << TargetPrefix << "Intrinsic::ID "
713 OS << "Intrinsic::ID Intrinsic::getIntrinsicForGCCBuiltin(const char "
735 OS << "(" << TargetPrefix << "Intrinsic::ID)";
736 OS << "Intrinsic::not_intrinsic;\n";