[TableGen][CodeEmitterGen] Fix SubOpAliases MIOperandNo mixup
authorIlya Leoshkevich <iii@linux.ibm.com>
Thu, 13 Jul 2023 15:28:14 +0000 (17:28 +0200)
committerIlya Leoshkevich <iii@linux.ibm.com>
Thu, 13 Jul 2023 15:28:22 +0000 (17:28 +0200)
commit0249ea611f55ed7ddce978289578bd01b80cfbcf
tree63528bc9ce2a5cd5aa6dc167240801fca8b5fe0d
parentfa46feb3148133f4fd540c6d8f912d7980a27515
[TableGen][CodeEmitterGen] Fix SubOpAliases MIOperandNo mixup

SubOpAliases maps a sub-operand name to the respective operand's index
and the sub-operand number within this operand. The operand index is
used for the Operands array.

Currently MIOperandNo is used as the operand index, which is not
correct. For example, if there are 2 operands with 3 sub-operands each:

  (ins (bdladdr12onlylen4 $B1, $D1, $L1):$BDL1,
       (bdladdr12onlylen4 $B2, $D2, $L2):$BDL2)

then B2's operand index will be 3, but the correct value is 1.

Reviewed By: jyknight

Differential Revision: https://reviews.llvm.org/D155158
llvm/utils/TableGen/CodeGenInstruction.cpp