[AsmParser] Match mandatory operands following optional operands.
authorIvan Kosarev <ivan.kosarev@amd.com>
Mon, 7 Nov 2022 10:22:51 +0000 (10:22 +0000)
committerIvan Kosarev <ivan.kosarev@amd.com>
Thu, 10 Nov 2022 12:49:27 +0000 (12:49 +0000)
commitef848f27d74dcff6455f05890566333bddbdb77e
tree3db91deef72767089880427cd57c8a94e2885954
parentaf6b1f797f946c560f8a7b0e647f51e23d4c666f
[AsmParser] Match mandatory operands following optional operands.

Currently, the asm parser stops matching instruction operands as soon as
the first optional operand is encountered. This leads to the need for
custom checks on missing mandatory operands that come after optional
operands.

The patch changes the parser to always match all optional and mandatory
instruction operands, thus making the custom checks unnecessary. This is
particularly useful for the AMDGPU backend where we have numerous
optional instruction modifiers.

Differential Revision: https://reviews.llvm.org/D137549
llvm/utils/TableGen/AsmMatcherEmitter.cpp