[llvm] [TableGen] Introduce a less aggressive suppression for HwMode Decoder… (PR #86060)

via llvm-commits llvm-commits at lists.llvm.org
Wed Mar 20 19:41:58 PDT 2024


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 631248dcd26fdec772cedb569be94ff8f12d0901 478b4e1b77c6cf48321489fe71d86b2de220d33c -- llvm/utils/TableGen/DecoderEmitter.cpp
``````````

</details>

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

``````````diff
diff --git a/llvm/utils/TableGen/DecoderEmitter.cpp b/llvm/utils/TableGen/DecoderEmitter.cpp
index 1759e2c75b..afdaae3f24 100644
--- a/llvm/utils/TableGen/DecoderEmitter.cpp
+++ b/llvm/utils/TableGen/DecoderEmitter.cpp
@@ -63,13 +63,17 @@ enum SuppressLevel {
 cl::opt<SuppressLevel> DecoderEmitterSuppressDuplicates(
     "suppress-per-hwmode-duplicates",
     cl::desc("Suppress duplication of instrs into per-HwMode decoder tables"),
-    cl::values(clEnumValN(SUPPRESSION_DISABLE, "O0",
-                          "Do not prevent DecoderTable duplications caused by HwModes"),
-               clEnumValN(SUPPRESSION_LEVEL1, "O1",
-                          "Remove duplicate DecoderTable entries generated due to HwModes"),
-               clEnumValN(SUPPRESSION_LEVEL2, "O2",
-                          "Extract HwModes-specific instructions into new DecoderTables, "
-                          "significantly reducing Table Duplications")),
+    cl::values(
+        clEnumValN(
+            SUPPRESSION_DISABLE, "O0",
+            "Do not prevent DecoderTable duplications caused by HwModes"),
+        clEnumValN(
+            SUPPRESSION_LEVEL1, "O1",
+            "Remove duplicate DecoderTable entries generated due to HwModes"),
+        clEnumValN(
+            SUPPRESSION_LEVEL2, "O2",
+            "Extract HwModes-specific instructions into new DecoderTables, "
+            "significantly reducing Table Duplications")),
     cl::init(SUPPRESSION_DISABLE), cl::cat(DisassemblerEmitterCat));
 
 namespace {
@@ -2458,9 +2462,11 @@ static void collectHwModesReferencedForEncodings(
   });
 }
 
-static void handleHwModesUnrelatedEncodings(
-    const CodeGenInstruction *Instr, const std::vector<StringRef> &HwModeNames,
-    NamespacesHwModesMap &NamespacesWithHwModes, std::vector<EncodingAndInst> &GlobalEncodings) {
+static void
+handleHwModesUnrelatedEncodings(const CodeGenInstruction *Instr,
+                                const std::vector<StringRef> &HwModeNames,
+                                NamespacesHwModesMap &NamespacesWithHwModes,
+                                std::vector<EncodingAndInst> &GlobalEncodings) {
   const Record *InstDef = Instr->TheDef;
 
   switch (DecoderEmitterSuppressDuplicates) {
@@ -2470,8 +2476,8 @@ static void handleHwModesUnrelatedEncodings(
     break;
   }
   case SUPPRESSION_LEVEL1: {
-    std::string DecoderNamespace = std::string(
-      InstDef->getValueAsString("DecoderNamespace"));
+    std::string DecoderNamespace =
+        std::string(InstDef->getValueAsString("DecoderNamespace"));
     for (StringRef HwModeName : HwModeNames) {
       if (NamespacesWithHwModes.count(DecoderNamespace) > 0 &&
           NamespacesWithHwModes[DecoderNamespace].count(HwModeName) > 0) {

``````````

</details>


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


More information about the llvm-commits mailing list