[PATCH] D121157: [AMDGPU] always use underlying object in the pointsToConstantMemory

Matt Arsenault via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Mar 7 14:00:28 PST 2022


arsenm added inline comments.


================
Comment at: llvm/lib/Target/AMDGPU/AMDGPUAliasAnalysis.cpp:135
   const Value *Base = getUnderlyingObject(Loc.Ptr);
-  AS = Base->getType()->getPointerAddressSpace();
   if (AS == AMDGPUAS::CONSTANT_ADDRESS ||
----------------
rampitec wrote:
> arsenm wrote:
> > I think using the getUnderlyingObject result has the same fundamental problem. It looks as far back as it can, but doesn't necessarily find the object definition. e.g. you could hit a call that returns the pointer which casted the pointer inside it
> A call shall return what function type prescribes. I would guess if a function returns a pointer constant address space it promises the constantness of the memory, otherwise constant will lose it whole point.
It's exactly the same logic as the direct cast. i agree constant address space is useless and should be removed


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

https://reviews.llvm.org/D121157



More information about the llvm-commits mailing list