AMDGPU: Avoid using 64-bit shift for i64 (shl x, 32)
authorMatt Arsenault <Matthew.Arsenault@amd.com>
Tue, 14 Jul 2015 18:20:33 +0000 (18:20 +0000)
committerMatt Arsenault <Matthew.Arsenault@amd.com>
Tue, 14 Jul 2015 18:20:33 +0000 (18:20 +0000)
commitba38e6c2aedf1787e90fa01a0f18c7ab22ddbb3e
tree9173cb2300ed4b33c9d1cd92d236b621aba0764f
parent3aa0d7cb535392d8733daa41c12cf8c86895e4d9
AMDGPU: Avoid using 64-bit shift for i64 (shl x, 32)

This can be done only with moves which theoretically
will optimize better later.

Although this transform increases the instruction count,
it should be code size / cycle count neutral in the worst
VALU case. It also seems to slightly improve a couple
of testcases due to other DAG combines this exposes.

This is probably slightly worse for the SALU case, so
it might be better to handle this during moveToVALU,
although then you lose some simplifications like
the load width reducing in the simple testcase.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@242177 91177308-0d34-0410-b5e6-96231b3b80d8
lib/Target/AMDGPU/AMDGPUISelLowering.cpp
lib/Target/AMDGPU/AMDGPUISelLowering.h
test/CodeGen/AMDGPU/array-ptr-calc-i64.ll
test/CodeGen/AMDGPU/mul_uint24.ll
test/CodeGen/AMDGPU/shl.ll
test/CodeGen/AMDGPU/srl.ll