[llvm] [RFC][CodeGen] Add generic target feature checks for intrinsics (PR #201470)
Matt Arsenault via llvm-commits
llvm-commits at lists.llvm.org
Thu Jun 4 01:53:34 PDT 2026
================
@@ -306,6 +311,33 @@ static constexpr unsigned IntrinsicNameOffsetTable[] = {
OS << "\n}; // IntrinsicNameOffsetTable\n";
}
+void IntrinsicEmitter::EmitIntrinsicToTargetFeaturesTable(
+ const CodeGenIntrinsicTable &Ints, raw_ostream &OS) {
+ StringToOffsetTable Table;
+ for (const CodeGenIntrinsic &Int : Ints)
+ Table.GetOrAddStringOffset(Int.TargetFeatures);
+
+ IfDefEmitter IfDef(OS, "GET_INTRINSIC_TARGET_FEATURES_TABLE");
+ OS << R"(// Intrinsic ID to required target features table.
+// Note that entry #0 is the invalid intrinsic!
+
+)";
+
+ Table.EmitStringTableDef(OS, "IntrinsicTargetFeaturesTable");
+
+ OS << R"(
+static constexpr unsigned IntrinsicTargetFeaturesOffsetTable[] = {
----------------
arsenm wrote:
I'd expect this to emit the feature bit vector instead of the string?
https://github.com/llvm/llvm-project/pull/201470
More information about the llvm-commits
mailing list