[PATCH] D38569: Expose must/may alias info in MemorySSA.

Daniel Berlin via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Oct 4 18:30:26 PDT 2017


dberlin added inline comments.


================
Comment at: lib/Analysis/MemorySSA.cpp:269
   if (UseCS) {
     ModRefInfo I = AA.getModRefInfo(DefInst, UseCS);
     return I != MRI_NoModRef;
----------------
It is possible for a call to must-alias a single thing, no?



================
Comment at: lib/Analysis/MemorySSA.cpp:297
+    // Must return if location is modified, not AResult != NoAlias;
+    return AA.getModRefInfo(DefInst, UseLoc) & MRI_Mod;
+  }
----------------
So this is going to double the number of alias calls, unfortunately. I suspect it will make building significantly slower, since roughly *all* time is spent there.

Do you have perf numbers to say one way or the other?

(unfortunately, ->alias is not const, so it will call it again)
I think we may need to finally implement some small LRU aliasing cache or something to make this fast enough.

Or 
1.  Optionally pass the aliasing result into getModRefInfo, which would be a really weird API).
2. Optionally return the aliasing result from getModRefInfo, which may make more sense.




================
Comment at: lib/Analysis/MemorySSA.cpp:2116
+      MUD->setOptimized(DefiningAccess);
+      MUD->setDefiningToMustAlias();
+    }
----------------
I'm a little concerned about saying we must-alias the live on entry def.
It's abstractly true, but i wonder if stuff will get confusingly broken.

LiveOnEntry is really equivalent to "something before this function" not "one specific thing".

Thoughts?


https://reviews.llvm.org/D38569





More information about the llvm-commits mailing list