Home | History | Annotate | Download | only in TableGen

Lines Matching defs: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.
138 // Sort in reverse order of intrinsic name so "abc.def" appears after
151 // Build a 'first character of function name' -> intrinsic # mapping.
162 // Emit the intrinsic matching stuff by first letter.
177 std::string Result = "return " + TargetPrefix + "Intrinsic::" +
204 OS << "// Intrinsic ID to name table\n";
206 OS << " // Note that entry #0 is the invalid intrinsic!\n";
215 OS << "// Intrinsic ID to overload bitset\n";
220 // Add one to the index so we emit a null bit for the invalid #0 intrinsic.
227 // 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!");
352 default: PrintFatalError("unhandled vector type width in intrinsic!");
372 /// intrinsic into 32 bits, return it. If not, return ~0U.
406 // If we can compute a 32-bit fixed encoding for this intrinsic, do so and
416 // Get the signature for the intrinsic.
451 OS << "// Global intrinsic function declaration type table.\n";
492 static ModRefKind getModRefKind(const CodeGenIntrinsic &intrinsic) {
493 switch (intrinsic.ModRef) {
528 /// EmitAttributes - This emits the Intrinsic::getAttributes method.
535 << "Intrinsic::ID id) {\n";
537 OS << "AttributeSet Intrinsic::getAttributes(LLVMContext &C, ID id) {\n";
546 const CodeGenIntrinsic &intrinsic = Ints[i];
548 std::max(maxArgAttrs, unsigned(intrinsic.ArgumentAttributes.size()));
549 unsigned &N = UniqAttributes[&intrinsic];
560 const CodeGenIntrinsic &intrinsic = Ints[i];
562 OS << " " << UniqAttributes[&intrinsic] << ", // "
563 << intrinsic.Name << "\n";
573 OS << "Intrinsic::num_intrinsics";
582 const CodeGenIntrinsic &intrinsic = *(I->first);
588 unsigned ai = 0, ae = intrinsic.ArgumentAttributes.size();
591 unsigned argNo = intrinsic.ArgumentAttributes[ai].first;
596 switch (intrinsic.ArgumentAttributes[ai].second) {
609 } while (ai != ae && intrinsic.ArgumentAttributes[ai].first == argNo);
616 ModRefKind modRef = getModRefKind(intrinsic);
618 if (!intrinsic.canThrow || modRef || intrinsic.isNoReturn) {
621 if (!intrinsic.canThrow)
623 if (intrinsic.isNoReturn)
655 /// EmitModRefBehavior - Determine intrinsic alias analysis mod/ref behavior.
658 OS << "// Determine intrinsic alias analysis mod/ref behavior.\n"
660 << "assert(iid <= Intrinsic::" << Ints.back().EnumName << " && "
661 << "\"Unknown intrinsic.\");\n\n";
701 "return " + TargetPrefix + "Intrinsic::" + I->second + ";";
721 PrintFatalError("Intrinsic '" + Ints[i].TheDef->getName() +
726 OS << "// Get the LLVM intrinsic that corresponds to a GCC builtin.\n";
733 OS << "static " << TargetPrefix << "Intrinsic::ID "
737 OS << "Intrinsic::ID Intrinsic::getIntrinsicForGCCBuiltin(const char "
759 OS << "(" << TargetPrefix << "Intrinsic::ID)";
760 OS << "Intrinsic::not_intrinsic;\n";