[PATCH] D119886: [AMDGPU] Promote recursive loads from kernel argument to constant

Stanislav Mekhanoshin via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Feb 17 00:38:58 PST 2022


rampitec added inline comments.


================
Comment at: llvm/lib/Target/AMDGPU/AMDGPUPromoteKernelArguments.cpp:155
+  PointerType *NewPT =
+      PointerType::getWithSamePointeeType(PT, AMDGPUAS::CONSTANT_ADDRESS);
+  Value *Cast = B.CreateAddrSpaceCast(OrigPtr, NewPT,
----------------
vpykhtin wrote:
> 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()
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.


CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D119886/new/

https://reviews.llvm.org/D119886



More information about the llvm-commits mailing list