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.
Paths
| Differential D24273
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 Also fixes initially selecting 32-bit versions of some instructions
Diff Detail Event TimelineComment Actions LGTM. One comment below.
This revision is now accepted and ready to land.Sep 8 2016, 1:29 AM
Revision Contents
Diff 70443 lib/Target/AMDGPU/SIInstrInfo.cpp
lib/Target/AMDGPU/SIInstructions.td
lib/Target/AMDGPU/SIShrinkInstructions.cpp
test/CodeGen/AMDGPU/ctlz.ll
test/CodeGen/AMDGPU/fneg-fabs.ll
test/CodeGen/AMDGPU/half.ll
test/CodeGen/AMDGPU/llvm.amdgcn.rsq.clamp.ll
test/CodeGen/AMDGPU/or.ll
test/CodeGen/AMDGPU/s_movk_i32.ll
test/CodeGen/AMDGPU/si-literal-folding.ll
|
Wouldn't it be even better to use s_brev_b32 sNN, 1 here?