This is an archive of the discontinued LLVM Phabricator instance.

AMDGPU: Exclude SGPRs except m0 from movrel operands
AbandonedPublic

Authored by arsenm on Oct 7 2015, 12:17 PM.

Details

Reviewers
tstellarAMD
Summary

Due to the constant bus restriction a literal constant
or SGPR other than m0 can't be used depite the operand
encoding. Fix the operand class to avoid having to manually
legalize the constant bus restriction.

The test change is a surprising scheduling change which
I'm not really sure why it happened since none of these
instructions are used in it. I'm guessing one of the generated
getCommon*Class functions now behaves somewhat differently.
This could probably be avoided by not allowing m0 either,
since that is probably not really useful.

Diff Detail

Event Timeline

arsenm updated this revision to Diff 36777.Oct 7 2015, 12:17 PM
arsenm retitled this revision from to AMDGPU: Exclude SGPRs except m0 from movrel operands.
arsenm updated this object.
arsenm added a reviewer: tstellarAMD.
arsenm added a subscriber: llvm-commits.
arsenm updated this revision to Diff 36778.Oct 7 2015, 12:25 PM

Set isAllocatable = 0 to fix test changes

I've seen scheduler changes like this before. I think adding the new register class affects the register pressure analysis.

lib/Target/AMDGPU/SIInstructions.td
1344–1347

Using M0 as src1, is only possible for V_MOVERELD_B32, because the other two use src1 as the base register and aren't actually reading values from it.

arsenm updated this revision to Diff 37211.Oct 12 2015, 8:43 PM
arsenm edited edge metadata.

Only allow for movreld. The test change is apparently still necessary even with isAllocatable = 0 for some reason

tstellarAMD accepted this revision.Oct 20 2015, 3:18 PM
tstellarAMD edited edge metadata.

LGTM.

This revision is now accepted and ready to land.Oct 20 2015, 3:18 PM

Looks like patch was not committed.

arsenm abandoned this revision.Oct 18 2019, 5:20 PM