[PATCH] New alias analysis for static global variables

hfinkel at anl.gov hfinkel at anl.gov
Mon Jun 22 19:32:25 PDT 2015

In http://reviews.llvm.org/D10059#186158, @samparker wrote:

> I have rewritten the pass as an Immutable pass, as the module pass seemed to get invalidated and hardly ever used.  This does mean that it has to perform the analysis fully every time it is queried, and this increases compilation time of LNT by ~1.1%. It now uses the CaptureTracking system already provided in the LLVM code base.

It seems sad that you really can't cache the results. You could mark all of the transformations are preserving the analysis. Do we have any transformations that would capture the address of a global where it had not been captured before?

Comment at: lib/Analysis/StaticGlobalsAA.cpp:146
@@ +145,3 @@
+    // Get the base object these pointers point to.
+    const Value *UV1 = GetUnderlyingObject(LocA.Ptr, *DL);
+    const Value *UV2 = GetUnderlyingObject(LocB.Ptr, *DL);
I'd like to see these calls to GetUnderlyingObjects, and then you can check "all" of the underlying objects to see if all underlying objects in one of the sets are derived from non-addr-taken globals.



More information about the llvm-commits mailing list