[llvm] [LLVM] Change Intrinsic::ID to encode target and intrinsic index (PR #113576)

Rahul Joshi via llvm-commits llvm-commits at lists.llvm.org
Fri Oct 25 13:50:00 PDT 2024


================
@@ -155,13 +158,13 @@ void IntrinsicEmitter::EmitEnumInfo(const CodeGenIntrinsicTable &Ints,
 
   OS << "// Enum values for intrinsics.\n";
   bool First = true;
-  for (const auto &Int : Ints[*Set]) {
+  for (const auto &Int : Set->getIntrinsics()) {
     OS << "    " << Int.EnumName;
 
     // Assign a value to the first intrinsic in this target set so that all
     // intrinsic ids are distinct.
     if (First) {
-      OS << " = " << Set->Offset + 1;
+      Intrinsic::PrintIntrinsicIDEncoding(OS, Set->TargetIndex, 0);
----------------
jurahul wrote:

Also, note that on discourse the desire to have stable IDs has been questioned, so it would be best to resolve that discussion first before adding more features in service of stable intrinsic IDs.

https://github.com/llvm/llvm-project/pull/113576


More information about the llvm-commits mailing list