[AMDGPURewriteOutArguments] Don't use pointer element type
authorNikita Popov <npopov@redhat.com>
Tue, 8 Feb 2022 12:52:02 +0000 (13:52 +0100)
committerNikita Popov <npopov@redhat.com>
Tue, 8 Feb 2022 15:10:41 +0000 (16:10 +0100)
commit997027347db7c704d14d5901c828a0f249d30c3f
treee129b81a7e62719a1dac2519b48b6a5320948fd0
parent0b00cd19e6f3ec168b9930f235bafd5e00253dbf
[AMDGPURewriteOutArguments] Don't use pointer element type

Instead of using the pointer element type, look at how the pointer
is actually being used in store instructions, while looking through
bitcasts. This makes the transform compatible with opaque pointers
and a bit more general.

It's worth noting that I have dropped the 3-vector to 4-vector
shufflevector special case, because this is now handled in a
different way: If the value is actually used as a 4-vector, then
we're directly going to use that type, instead of shuffling to a
3-vector in between.

Differential Revision: https://reviews.llvm.org/D119237
llvm/lib/Target/AMDGPU/AMDGPURewriteOutArguments.cpp
llvm/test/CodeGen/AMDGPU/rewrite-out-arguments-address-space.ll
llvm/test/CodeGen/AMDGPU/rewrite-out-arguments.ll