[llvm] [TableGen] Bug fix for tied optional operands resolution (PR #83588)

Sergei Barannikov via llvm-commits llvm-commits at lists.llvm.org
Fri Mar 1 17:28:26 PST 2024


================
@@ -1986,9 +1986,9 @@ emitConvertFuncs(CodeGenTarget &Target, StringRef ClassName,
   }
   CvtOS << "  assert(Kind < CVT_NUM_SIGNATURES && \"Invalid signature!\");\n";
   CvtOS << "  const uint8_t *Converter = ConversionTable[Kind];\n";
-  CvtOS << "  unsigned OpIdx;\n";
   CvtOS << "  Inst.setOpcode(Opcode);\n";
   CvtOS << "  for (const uint8_t *p = Converter; *p; p += 2) {\n";
+  CvtOS << "    unsigned OpIdx;\n";
----------------
s-barannikov wrote:

Since you're moving the declaration, you can also fuse fuse it with the definition (`unsigned OpIdx = ...`).


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


More information about the llvm-commits mailing list