[PATCH] D12064: [GMR] isNonEscapingGlobalNoAlias() should look through Bitcasts/GEPs when looking at loads.

hfinkel@anl.gov via llvm-commits llvm-commits at lists.llvm.org
Sun Aug 16 10:30:40 PDT 2015


hfinkel added a subscriber: hfinkel.

================
Comment at: lib/Analysis/IPA/GlobalsModRef.cpp:654
@@ -653,3 +653,3 @@
       // that the global is non-escaping, so no alias.
-      if (isa<GlobalValue>(LI->getPointerOperand()))
+      if (isa<GlobalValue>(GetUnderlyingObject(LI->getPointerOperand(), *DL)))
         continue;
----------------
It seems like we could make this more general is two ways:

 1. Call GetUnderlyingObjects, and checking that all of the results are GlobalValues

 2. Also checking that the underlying objects are not arguments or call/invoke return values.

If I'm reading this code correctly, one possible way of handling this, is just to do this:

  push.Inputs(LI->getPointerOperand());
  continue;

which seems to accomplish both things, and keeps an integrated Depth constraint.



http://reviews.llvm.org/D12064





More information about the llvm-commits mailing list