[PATCH] D91649: [AA] Split up LocationSize::unknown()

Florian Hahn via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Nov 25 03:36:05 PST 2020

fhahn accepted this revision.
fhahn added a comment.

This looks like a great improvement, thanks!

Comment at: llvm/lib/Analysis/BasicAliasAnalysis.cpp:1742
+  // If one the accesses may be below the accessed pointer, canonicalize this
+  // by using unknown after-pointer sizes for both accesses. This is
nit: `may be before` instead of `may be below`, as the function is called `mayBeBeforePoitner`?

Comment at: llvm/lib/Transforms/Scalar/DeadStoreElimination.cpp:290
     // first argument.
-    return MemoryLocation(CB->getArgOperand(0), LocationSize::unknown());
+    return MemoryLocation::getAfter(CB->getArgOperand(0));
   return MemoryLocation();
nikic wrote:
> asbirlea wrote:
> > `getBeforeOrAfter`?
> If I'm understanding the context here right, this function only deals with accesses for which hasAnalyzableMemoryWrite() returns true, i.e. strcpy, strncpy, strcat and strncat in this branch. These functions don't access memory before the passed pointer.
yes, only known TLI functions should reach here.



More information about the llvm-commits mailing list