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

Stanislav Mekhanoshin via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Mar 7 14:03:23 PST 2022


rampitec 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 ||
----------------
arsenm wrote:
> 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
I see one exception though: a call originates at an user's code and a call signature is a promise. A direct cast can be generated. The difference is foggy but still seem to exist.


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

https://reviews.llvm.org/D121157



More information about the llvm-commits mailing list