This is an archive of the discontinued LLVM Phabricator instance.

[AMDGPU][MC][GFX908] Corrected src0 of v_accvgpr_write to accept only VGPRs and inline constants.
ClosedPublic

Authored by dp on May 25 2020, 12:01 PM.

Details

Summary

v_accvgpr_write may only use VGPRs and inline constants as src0.
This change disables use of special SGPR registers like scc, vccz, execz, etc.

See bug 45414.

Diff Detail

Event Timeline

dp created this revision.May 25 2020, 12:01 PM
arsenm added inline comments.May 26 2020, 7:57 AM
llvm/lib/Target/AMDGPU/AsmParser/AMDGPUAsmParser.cpp
3167–3170

This isn't checking the constant values as the error implies

llvm/test/MC/AMDGPU/mai.s
42

Test with inline immediate and non-inline immediate constants?

dp marked 4 inline comments as done.May 26 2020, 9:09 AM
dp added inline comments.
llvm/lib/Target/AMDGPU/AsmParser/AMDGPUAsmParser.cpp
3167–3170

I'll re-title the change and update description

llvm/test/MC/AMDGPU/mai.s
42

A test for an inline immediate already exists - see "v_accvgpr_write_b32 a2, -2" above.
I'll add a test for a non-inline immediate.

dp updated this revision to Diff 266241.May 26 2020, 9:15 AM
dp marked 2 inline comments as done.
dp retitled this revision from [AMDGPU][MC][GFX908] Disabled SGPRs as src0 of v_accvgpr_write to [AMDGPU][MC][GFX908] Corrected src0 of v_accvgpr_write to accept only VGPRs and inline constants..
dp edited the summary of this revision. (Show Details)
rampitec added inline comments.May 26 2020, 9:55 AM
llvm/lib/Target/AMDGPU/AsmParser/AMDGPUAsmParser.cpp
1349

Can you rename it to validateMAIAccWrite? This is not a load.

dp updated this revision to Diff 266265.May 26 2020, 10:31 AM

Renamed validateMAIAccLoad to validateMAIAccWrite.

rampitec accepted this revision.May 26 2020, 10:57 AM
This revision is now accepted and ready to land.May 26 2020, 10:57 AM
This revision was automatically updated to reflect the committed changes.