[llvm] [ARM][TableGen][MC] Change the ARM mnemonic operands to be optional for ASM parsing (PR #83436)

Sergei Barannikov via llvm-commits llvm-commits at lists.llvm.org
Thu Feb 29 10:27:13 PST 2024


================
@@ -88,23 +88,26 @@ unsigned PseudoLoweringEmitter::addDagOperandMapping(
 
       // Normal operands should always have the same type, or we have a
       // problem.
-      // FIXME: We probably shouldn't ever get a non-zero BaseIdx here.
-      assert(BaseIdx == 0 && "Named subargument in pseudo expansion?!");
+
       // FIXME: Are the message operand types backward?
-      if (DI->getDef() != Insn.Operands[BaseIdx + i].Rec) {
+      if (DI->getDef() != Insn.Operands[i].Rec) {
----------------
s-barannikov wrote:

This does not look right. We do need BaseIdx because this function is called recursively for complex operands, and BaseIdx is the offset of the first flattened sub-operand of a complex operand.
(Side note: it is probably not a good idea to call this function recursively in the first place, it is very difficult to follow the logic.)


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


More information about the llvm-commits mailing list