AMDGPU: Fix immediate folding logic when shrinking instructions
authorMatt Arsenault <Matthew.Arsenault@amd.com>
Fri, 9 Sep 2016 23:32:53 +0000 (23:32 +0000)
committerMatt Arsenault <Matthew.Arsenault@amd.com>
Fri, 9 Sep 2016 23:32:53 +0000 (23:32 +0000)
commit124384f08d4cb9b8c698951ed67fd6db79a15d15
treebef6b9dcd6420bcf678b0e617646e70bb06947c8
parent8dc0e0943b9e9b864b91a50e991392db09f2dc49
AMDGPU: Fix immediate folding logic when shrinking instructions

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.

llvm-svn: 281117
llvm/lib/Target/AMDGPU/SIInstrInfo.cpp
llvm/lib/Target/AMDGPU/SIInstructions.td
llvm/lib/Target/AMDGPU/SIShrinkInstructions.cpp
llvm/test/CodeGen/AMDGPU/ctlz.ll
llvm/test/CodeGen/AMDGPU/fneg-fabs.ll
llvm/test/CodeGen/AMDGPU/half.ll
llvm/test/CodeGen/AMDGPU/llvm.amdgcn.rsq.clamp.ll
llvm/test/CodeGen/AMDGPU/or.ll
llvm/test/CodeGen/AMDGPU/s_movk_i32.ll
llvm/test/CodeGen/AMDGPU/si-literal-folding.ll