This is an archive of the discontinued LLVM Phabricator instance.

[AMDGPU] SDWA: merge VI and GFX9 pseudo instructions
ClosedPublic

Authored by SamWot on Jun 8 2017, 4:18 AM.

Details

Summary

Previously there were two separate pseudo instruction for SDWA on VI and on GFX9. Created one pseudo instruction that is union of both of them. Added verifier to check that operands conform either VI or GFX9.

Diff Detail

Repository
rL LLVM

Event Timeline

SamWot created this revision.Jun 8 2017, 4:18 AM
arsenm added inline comments.Jun 8 2017, 6:05 PM
lib/Target/AMDGPU/SIInstrInfo.cpp
2442 ↗(On Diff #101885)

Should check the SDWA feature rather than the generations. Also none of these checks should be using the AMDGPU::* things that MC needs to use, they can be checked directly from ST

2465–2468 ↗(On Diff #101885)

You don't need to check these kinds of restrictions because they are already enforced by the regular register class constraints

2500–2502 ↗(On Diff #101885)

Message mentions omod but not checking omod?

2519 ↗(On Diff #101885)

Generation check inappropriate here

SamWot updated this revision to Diff 102001.Jun 9 2017, 1:17 AM
SamWot marked 3 inline comments as done.

Fixed issues in SIInstrInfo.cpp

lib/Target/AMDGPU/SIInstrInfo.cpp
2519 ↗(On Diff #101885)

On VI there can only be VGPRs as operands (it is checked earlier). So verifying constant bus limitations for VI is needless.

arsenm added inline comments.Jun 9 2017, 8:24 AM
lib/Target/AMDGPU/SIInstrInfo.cpp
2519 ↗(On Diff #101885)

I would rather it just fall through to the normal constant bus checks, rather than adding an ad-hoc check like this here. The point of this is for debugging so it's not like there's any point trying to optimize this.

SamWot updated this revision to Diff 102307.Jun 13 2017, 3:01 AM

Removed generation check from constant bus verification.

dp accepted this revision.Jun 16 2017, 2:31 AM

Looks good

This revision is now accepted and ready to land.Jun 16 2017, 2:31 AM
This revision was automatically updated to reflect the committed changes.