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

Chris Lattner sabre at nondot.org
Mon Dec 21 17:00:32 PST 2009


Author: lattner
Date: Mon Dec 21 19:00:32 2009
New Revision: 91869

URL: http://llvm.org/viewvc/llvm-project?rev=91869&view=rev
Log:
avoid calling extractMallocCall when it's obvious we don't have
a call.  This speeds up memdep ~1.5%

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=91869&r1=91868&r2=91869&view=diff

==============================================================================
--- llvm/trunk/lib/Analysis/MemoryDependenceAnalysis.cpp (original)
+++ llvm/trunk/lib/Analysis/MemoryDependenceAnalysis.cpp Mon Dec 21 19:00:32 2009
@@ -275,7 +275,8 @@
     // a subsequent bitcast of the malloc call result.  There can be stores to
     // the malloced memory between the malloc call and its bitcast uses, and we
     // need to continue scanning until the malloc call.
-    if (isa<AllocaInst>(Inst) || extractMallocCall(Inst)) {
+    if (isa<AllocaInst>(Inst) ||
+        (isa<CallInst>(Inst) && extractMallocCall(Inst))) {
       Value *AccessPtr = MemPtr->getUnderlyingObject();
       
       if (AccessPtr == Inst ||





More information about the llvm-commits mailing list