[llvm-commits] [llvm] r156687 - /llvm/trunk/lib/Analysis/MemoryDependenceAnalysis.cpp

Chad Rosier mcrosier at apple.com
Fri May 11 17:43:40 PDT 2012


Author: mcrosier
Date: Fri May 11 19:43:40 2012
New Revision: 156687

URL: http://llvm.org/viewvc/llvm-project?rev=156687&view=rev
Log:
Hoist simpler checks above llvm::PointerMayBeCaptured. No functional change intended.

Modified:
    llvm/trunk/lib/Analysis/MemoryDependenceAnalysis.cpp

Modified: llvm/trunk/lib/Analysis/MemoryDependenceAnalysis.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Analysis/MemoryDependenceAnalysis.cpp?rev=156687&r1=156686&r2=156687&view=diff
==============================================================================
--- llvm/trunk/lib/Analysis/MemoryDependenceAnalysis.cpp (original)
+++ llvm/trunk/lib/Analysis/MemoryDependenceAnalysis.cpp Fri May 11 19:43:40 2012
@@ -386,15 +386,17 @@
   // with a smarter AA in place, this test is just wasting compile time.
   if (!DT) return AliasAnalysis::ModRef;
   const Value *Object = GetUnderlyingObject(MemLoc.Ptr, TD);
-  if (!isIdentifiedObject(Object) || isa<GlobalValue>(Object))
+  if (!isIdentifiedObject(Object) || isa<GlobalValue>(Object) ||
+      isa<Constant>(Object))
     return AliasAnalysis::ModRef;
+
   ImmutableCallSite CS(Inst);
-  if (!CS.getInstruction()) return AliasAnalysis::ModRef;
+  if (!CS.getInstruction() || CS.getInstruction() == Object)
+    return AliasAnalysis::ModRef;
 
   CapturesBefore CB(Inst, DT);
   llvm::PointerMayBeCaptured(Object, &CB);
-
-  if (isa<Constant>(Object) || CS.getInstruction() == Object || CB.Captured)
+  if (CB.Captured)
     return AliasAnalysis::ModRef;
 
   unsigned ArgNo = 0;





More information about the llvm-commits mailing list