Prevents potential matching of literal offsets to non-literal operands.
Details
Diff Detail
- Repository
- rG LLVM Github Monorepo
Unit Tests
Event Timeline
If there's a literal parsing issue seems like it should be straightforward?
There is no reproducer, and even if we have one, it would still be not reliable, because the order in which the internal AsmParser machinery tries to match operands is generally beyond our control.
What's interesting about this change is that defaultSMRDOffset8() and defaultSMRDLiteralOffset() are not updated to add ImmTyNone operands instead of ImmTyOffset and we still pass the tests. That's because we don't really have any GFX6 tests with these operands dropped, so no default values used. (Addressed in D142231.)
Does your patch fix this bug?
s_load_dword s5, s[2:3], glc
Assembler should trigger an error for GFX7, but glc is misinterpreted as offset operand.
I think your patch should fix this bug, so you may add this code as a test.
Does your patch fix this bug?
s_load_dword s5, s[2:3], glc
It does, thanks! Is there a ticket to be mentioned in the commit message?
Is there a ticket to be mentioned in the commit message?
There is no ticket. I found this bug while analyzing your patch and trying to break the parser.
LGTM, but I suggest moving the test to some other place. *_unsupported.s are used solely to test identification of unsupported opcodes. gfx7_err_pos.s may be a better place for this test.