This is an archive of the discontinued LLVM Phabricator instance.

[TableGen][CodeEmitterGen] Fix SubOpAliases MIOperandNo mixup
ClosedPublic

Authored by iii on Jul 13 2023, 12:22 AM.

Details

Summary

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.

Diff Detail

Event Timeline

iii created this revision.Jul 13 2023, 12:22 AM
Herald added a project: Restricted Project. · View Herald TranscriptJul 13 2023, 12:22 AM
iii requested review of this revision.Jul 13 2023, 12:22 AM
Herald added a project: Restricted Project. · View Herald TranscriptJul 13 2023, 12:22 AM

Huh, whoops -- does this change any tablegen codegen that's in-tree now?

iii added a comment.Jul 13 2023, 8:07 AM

Fortunately not. I found this while adding named sub-operand support to SystemZ.

jyknight accepted this revision.Jul 13 2023, 8:26 AM

Great, thanks!

This revision is now accepted and ready to land.Jul 13 2023, 8:26 AM
This revision was automatically updated to reflect the committed changes.