[PATCH] D119886: [AMDGPU] Promote recursive loads from kernel argument to constant
Valery Pykhtin via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Wed Feb 16 07:24:48 PST 2022
vpykhtin added inline comments.
================
Comment at: llvm/lib/Target/AMDGPU/AMDGPUPromoteKernelArguments.cpp:133
+ PointerType *PT = cast<PointerType>(Ptr->getType());
+ if (PT->getAddressSpace() == AMDGPUAS::CONSTANT_ADDRESS)
+ return false;
----------------
Nit: you can leave only the same check after the loop below
================
Comment at: llvm/lib/Target/AMDGPU/AMDGPUPromoteKernelArguments.cpp:138
+ Value *OrigPtr = Ptr;
+ while (isa<AddrSpaceCastInst>(OrigPtr))
+ OrigPtr = cast<AddrSpaceCastInst>(OrigPtr)->getPointerOperand();
----------------
Nit: you can shorten the loop unsing while (auto *P = dyn_cast<AddrSpaceCastInst>(OrigPtr)) ...
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D119886/new/
https://reviews.llvm.org/D119886
More information about the llvm-commits
mailing list