Not clobbered pointer load chains are promoted to global now. That
is possible to promote these loads itself into constant address
space. Loaded pointers still need to point to global because we
need to be able to store into that pointer and because an actual
load from it may occur after a clobber.
Details
Diff Detail
- Repository
- rG LLVM Github Monorepo
Event Timeline
llvm/lib/Target/AMDGPU/AMDGPUPromoteKernelArguments.cpp | ||
---|---|---|
138 | stripPointerCasts? |
llvm/lib/Target/AMDGPU/AMDGPUPromoteKernelArguments.cpp | ||
---|---|---|
138 | That's too much, I only need to strip address space casts. stripPointerCasts may change type. |
llvm/lib/Target/AMDGPU/AMDGPUPromoteKernelArguments.cpp | ||
---|---|---|
138 | addrspacecast may also change the element type, it's just not canonical |
Check pointee type in case addrspacecast changes it.
llvm/lib/Target/AMDGPU/AMDGPUPromoteKernelArguments.cpp | ||
---|---|---|
138 | Good point. Checking pointee type now. |
LGTM.
llvm/lib/Target/AMDGPU/AMDGPUPromoteKernelArguments.cpp | ||
---|---|---|
155 | I'm not sure if this would be easier to understand if you use Ptr->getType() here as you checked its the same as OrigPtr->getType() |
llvm/lib/Target/AMDGPU/AMDGPUPromoteKernelArguments.cpp | ||
---|---|---|
155 | Except for the address space it shall be exactly the same as the original pointer all the way of the cast chain. This is the whole point of the checks above. This is somewhat awkward to have a cast chain, but the alternative is to replicate a whole infer-address-space logic. |
Nit: you can leave only the same check after the loop below