[PATCH] D44748: Track whether the size of a MemoryLocation is precise

George Burgess IV via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Sep 18 12:55:24 PDT 2018


george.burgess.iv added inline comments.


================
Comment at: include/llvm/Analysis/AliasSetTracker.h:100
+    LocationSize getSize() const {
+      assert(isSizeSet() && "Getting an unset size!");
+      return Size;
----------------
(This is a functional change if we try to call `getSize()` before setting a size. In my tests a few months ago, this was never done in practice, and it frankly makes no sense to me to try to get an unset size. :)

I'll bootstrap clang once more to verify that this assert isn't tripped before committing)


================
Comment at: lib/Analysis/MemoryDependenceAnalysis.cpp:1115
   if (!Pair.second) {
-    if (CacheInfo->Size < Loc.Size) {
-      // The query's Size is greater than the cached one. Throw out the
----------------
reames wrote:
> This does not look NFC.
You're correct; it adds a case where if the preciseness of CacheInfo->Size isn't the same as `Loc.Size`'s, we'll throw everything out.

As noted in the comment, I can't get an imprecise value to land here in practice. If you'd rather I put an assertion about that here instead of `CacheInfo->Size.isPrecise() != Loc.Size.isPrecise()`, I'm happy to do so, but the rest of this should turn into the equivalent of what was `CacheInfo->Size < Loc.Size`.


https://reviews.llvm.org/D44748





More information about the llvm-commits mailing list