This is an archive of the discontinued LLVM Phabricator instance.

AMDGPU: Fix immediate folding logic when shrinking instructions
ClosedPublic

Authored by arsenm on Sep 6 2016, 11:45 AM.

Details

Summary

If the literal is being folded into src0, it doesn't matter
if it's an SGPR because it's being replaced with the literal.

Also fixes initially selecting 32-bit versions of some instructions
which also confused commuting.

Diff Detail

Event Timeline

arsenm updated this revision to Diff 70443.Sep 6 2016, 11:45 AM
arsenm retitled this revision from to AMDGPU: Fix immediate folding logic when shrinking instructions.
arsenm updated this object.
arsenm added a reviewer: tstellarAMD.
arsenm added a subscriber: llvm-commits.
nhaehnle accepted this revision.Sep 8 2016, 1:29 AM
nhaehnle added a reviewer: nhaehnle.

LGTM. One comment below.

test/CodeGen/AMDGPU/fneg-fabs.ll
85–86

Wouldn't it be even better to use s_brev_b32 sNN, 1 here?

This revision is now accepted and ready to land.Sep 8 2016, 1:29 AM
arsenm added inline comments.Sep 8 2016, 10:05 AM
test/CodeGen/AMDGPU/fneg-fabs.ll
85–86

Yes, I forgot about the scalar case when I added the bfrev thing

arsenm closed this revision.Sep 14 2016, 8:44 AM

r281117