This is an archive of the discontinued LLVM Phabricator instance.

AMDGPU/SI: Don't move copies of immediates to the VALU
ClosedPublic

Authored by tstellarAMD on Nov 30 2016, 10:13 AM.

Details

Summary

If we write an immediate to a VGPR and then copy the VGPR to an
SGPR, we can replace the copy with a S_MOV_B32 sgpr, imm, rather than
moving the copy to the SALU.

Event Timeline

tstellarAMD retitled this revision from to AMDGPU/SI: Don't move copies of immediates to the VALU.
tstellarAMD updated this object.
tstellarAMD added a reviewer: arsenm.
tstellarAMD added a subscriber: llvm-commits.
arsenm added inline comments.Nov 30 2016, 10:19 AM
lib/Target/AMDGPU/SIFixSGPRCopies.cpp
319–320

I think this should be unreachable since we never emit this. I'm not sure the modifiers even work, so I don't think there's any reason to ever use this

370–371

This will leave behind the implicit exec use

Address review comments.

lib/Target/AMDGPU/SIFixSGPRCopies.cpp
370–371

MI is a copy here, so there are no implicit exec uses.

arsenm accepted this revision.Dec 3 2016, 11:16 PM
arsenm edited edge metadata.

LGTM

This revision is now accepted and ready to land.Dec 3 2016, 11:16 PM
This revision was automatically updated to reflect the committed changes.