[AMDGPU] Set noclobber metadata on loads instead of cast to constant
commit9eabea396814c5580978cd4766b524bef57844cf
authorStanislav Mekhanoshin <Stanislav.Mekhanoshin@amd.com>
Mon, 7 Mar 2022 23:53:16 +0000 (7 15:53 -0800)
committerStanislav Mekhanoshin <Stanislav.Mekhanoshin@amd.com>
Tue, 8 Mar 2022 07:13:02 +0000 (7 23:13 -0800)
tree9d616e077ef93600e4d60023266b3df13403f67e
parented28461e2716fda004f4f55654ef33bc8c78f203
[AMDGPU] Set noclobber metadata on loads instead of cast to constant

A load via pointer cast to constant will return true from
pointsToConstantMemory which is not necessarily so.

Fixes: SWDEV-326463

Differential Revision: https://reviews.llvm.org/D121172
clang/test/CodeGenCUDA/amdgpu-kernel-arg-pointer-type.cu
llvm/lib/Target/AMDGPU/AMDGPUPromoteKernelArguments.cpp
llvm/test/CodeGen/AMDGPU/promote-kernel-arguments.ll