[llvm] [llvm][TableGen] Split builtin lookup tables (PR #202644)

via llvm-commits llvm-commits at lists.llvm.org
Tue Jun 9 07:05:28 PDT 2026


github-actions[bot] wrote:

<!--LLVM CODE FORMAT COMMENT: {clang-format}-->


:warning: C/C++ code formatter, clang-format found issues in your code. :warning:

<details>
<summary>
You can test this locally with the following command:
</summary>

``````````bash
git-clang-format --diff origin/main HEAD --extensions cpp -- llvm/utils/TableGen/Basic/IntrinsicEmitter.cpp --diff_from_common_commit
``````````

:warning:
The reproduction instructions above might return results for more than one PR
in a stack if you are using a stacked PR workflow. You can limit the results by
changing `origin/main` to the base branch/commit you want to compare against.
:warning:

</details>

<details>
<summary>
View the diff from clang-format here.
</summary>

``````````diff
diff --git a/llvm/utils/TableGen/Basic/IntrinsicEmitter.cpp b/llvm/utils/TableGen/Basic/IntrinsicEmitter.cpp
index 496bd405e..9c4062d5f 100644
--- a/llvm/utils/TableGen/Basic/IntrinsicEmitter.cpp
+++ b/llvm/utils/TableGen/Basic/IntrinsicEmitter.cpp
@@ -994,8 +994,8 @@ Intrinsic::getIntrinsicFor{}Builtin(StringRef TargetPrefix,
 
     for (const auto &[BuiltinName, EnumName] : Map) {
       StringRef Suffix = BuiltinName.substr(CommonPrefix->size());
-      OS << "    {" << *Table.GetStringOffset(Suffix) << "}, // "
-         << BuiltinName << "\n";
+      OS << "    {" << *Table.GetStringOffset(Suffix) << "}, // " << BuiltinName
+         << "\n";
     }
     if (!TargetPrefix.empty())
       MaxTargetBuiltinCount = std::max(MaxTargetBuiltinCount, Map.size());
@@ -1050,8 +1050,8 @@ Intrinsic::getIntrinsicFor{}Builtin(StringRef TargetPrefix,
       IntrinsicIDOffset += Map.size();
       continue;
     }
-    OS << formatv(R"(    {{"{0}", {2}, {3}, "{1}"},)",
-                  TargetPrefix, CommonPrefix, IntrinsicIDOffset, Map.size())
+    OS << formatv(R"(    {{"{0}", {2}, {3}, "{1}"},)", TargetPrefix,
+                  CommonPrefix, IntrinsicIDOffset, Map.size())
        << "\n";
     IntrinsicIDOffset += Map.size();
   }
@@ -1060,7 +1060,8 @@ Intrinsic::getIntrinsicFor{}Builtin(StringRef TargetPrefix,
   // Now for the actual lookup, first check the target independent table if
   // we emitted one.
   if (HasTargetIndependentBuiltins) {
-    OS << formatv(R"(
+    OS << formatv(
+        R"(
   // Check if it's a target independent builtin.
   // Copy the builtin name so we can use it in consume_front without clobbering
   // if for the lookup in the target specific table.
@@ -1083,10 +1084,8 @@ Intrinsic::getIntrinsicFor{}Builtin(StringRef TargetPrefix,
       return static_cast<ID>(BuiltinIntrinsicIDs[{} + First]);
   }
 )",
-                  TargetIndepndentCommonPrefix,
-                  TargetIndependentIntrinsicIDOffset,
-                  TargetIndependentBuiltinCount,
-                  TargetIndependentIntrinsicIDOffset);
+        TargetIndepndentCommonPrefix, TargetIndependentIntrinsicIDOffset,
+        TargetIndependentBuiltinCount, TargetIndependentIntrinsicIDOffset);
   }
 
   // If a target independent builtin was not found, lookup the target specific.

``````````

</details>


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


More information about the llvm-commits mailing list