This is an archive of the discontinued LLVM Phabricator instance.

[AMDGPU][MC][GFX11] Add VOPD literals validation
ClosedPublic

Authored by dp on Sep 14 2022, 7:56 AM.

Diff Detail

Event Timeline

dp created this revision.Sep 14 2022, 7:56 AM
Herald added a project: Restricted Project. · View Herald TranscriptSep 14 2022, 7:56 AM
dp requested review of this revision.Sep 14 2022, 7:56 AM
Herald added a project: Restricted Project. · View Herald TranscriptSep 14 2022, 7:56 AM
dp added inline comments.Sep 14 2022, 8:23 AM
llvm/lib/Target/AMDGPU/Utils/AMDGPUBaseInfo.cpp
431

It turned out that getNamedOperandIdx is about 2 times faster than getVOPDOpcodeHelper.

Joe_Nash added inline comments.Sep 14 2022, 8:57 AM
llvm/test/MC/AMDGPU/gfx11_asm_vopd_errs.s
38

I would prefer if there are multiple literals that they are quite visually distinct, rather than just omitting a trailing character or permuting one character

42

It may be worth checking for the 'odd one out' literal in each possible position. 4 tests

dp updated this revision to Diff 460139.Sep 14 2022, 9:54 AM

Updated tests as suggested by Joe.

Joe_Nash accepted this revision.Sep 14 2022, 10:09 AM

Thanks for the test changes. See my comment about adding unique to error message, otherwise LGTM.

llvm/lib/Target/AMDGPU/AsmParser/AMDGPUAsmParser.cpp
4359

It seems helpful to say "only one unique literal operand is allowed".

This revision is now accepted and ready to land.Sep 14 2022, 10:09 AM
dp added inline comments.Sep 14 2022, 10:49 AM
llvm/lib/Target/AMDGPU/AsmParser/AMDGPUAsmParser.cpp
4359

It seems helpful to say "only one unique literal operand is allowed".

Thanks! I'll correct wording in a separate commit because the change will affect many existing tests.

This revision was automatically updated to reflect the committed changes.