[PATCH] D119886: [AMDGPU] Promote recursive loads from kernel argument to constant
Matt Arsenault via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Wed Feb 16 08:55:43 PST 2022
arsenm added inline comments.
================
Comment at: llvm/lib/Target/AMDGPU/AMDGPUPromoteKernelArguments.cpp:138
+ Value *OrigPtr = Ptr;
+ while (isa<AddrSpaceCastInst>(OrigPtr))
+ OrigPtr = cast<AddrSpaceCastInst>(OrigPtr)->getPointerOperand();
----------------
rampitec wrote:
> arsenm wrote:
> > rampitec wrote:
> > > vpykhtin wrote:
> > > > Nit: you can shorten the loop unsing while (auto *P = dyn_cast<AddrSpaceCastInst>(OrigPtr)) ...
> > > I need both Ptr and OrigPtr after the loop.
> > stripPointerCasts?
> That's too much, I only need to strip address space casts. stripPointerCasts may change type.
addrspacecast may also change the element type, it's just not canonical
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D119886/new/
https://reviews.llvm.org/D119886
More information about the llvm-commits
mailing list