[llvm] [TableGen] fix tlbgen for EncodingByHwMode (PR #84906)

via llvm-commits llvm-commits at lists.llvm.org
Fri Mar 15 03:23:16 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 ffe41819e58365dfbe85a22556c0d9d284e746b9 ffcba0aaab94c876328d2d29dcd8b811922dc35d -- llvm/utils/TableGen/CodeEmitterGen.cpp llvm/utils/TableGen/CodeGenHwModes.cpp llvm/utils/TableGen/DecoderEmitter.cpp llvm/utils/TableGen/DisassemblerEmitter.cpp llvm/utils/TableGen/RegisterInfoEmitter.cpp llvm/utils/TableGen/SubtargetEmitter.cpp
``````````

</details>

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

``````````diff
diff --git a/llvm/utils/TableGen/CodeEmitterGen.cpp b/llvm/utils/TableGen/CodeEmitterGen.cpp
index d1c6458647..bdfb40ef88 100644
--- a/llvm/utils/TableGen/CodeEmitterGen.cpp
+++ b/llvm/utils/TableGen/CodeEmitterGen.cpp
@@ -321,8 +321,8 @@ CodeEmitterGen::getInstructionCases(Record *R, CodeGenTarget &Target) {
       if (UseAPInt) {
         int NumWords = APInt::getNumWords(BitWidth);
         append("      Inst = APInt(" + itostr(BitWidth));
-        append(", ArrayRef(InstBitsByHw + opcode * " + itostr(NumWords) +
-               ", " + itostr(NumWords));
+        append(", ArrayRef(InstBitsByHw + opcode * " + itostr(NumWords) + ", " +
+               itostr(NumWords));
         append("));\n");
         append("      Value = Inst;\n");
       } else {
diff --git a/llvm/utils/TableGen/DecoderEmitter.cpp b/llvm/utils/TableGen/DecoderEmitter.cpp
index bfaad288d0..313fc5a3ba 100644
--- a/llvm/utils/TableGen/DecoderEmitter.cpp
+++ b/llvm/utils/TableGen/DecoderEmitter.cpp
@@ -2531,7 +2531,7 @@ void DecoderEmitter::run(raw_ostream &o) {
       if (NamespacesWithHwModes.count(DecoderNamespace) > 0) {
         if (NamespacesWithHwModes[DecoderNamespace].count(HwModeName) > 0) {
           NumberedEncodings.emplace_back(InstDef, NumberedInstruction,
-			                  HwModeName);
+                                         HwModeName);
         }
       } else {
         NumberedEncodings.emplace_back(InstDef, NumberedInstruction, "");

``````````

</details>


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


More information about the llvm-commits mailing list