avoid calling extractMallocCall when it's obvious we don't have
authorChris Lattner <sabre@nondot.org>
Tue, 22 Dec 2009 01:00:32 +0000 (01:00 +0000)
committerChris Lattner <sabre@nondot.org>
Tue, 22 Dec 2009 01:00:32 +0000 (01:00 +0000)
a call.  This speeds up memdep ~1.5%

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@91869 91177308-0d34-0410-b5e6-96231b3b80d8

lib/Analysis/MemoryDependenceAnalysis.cpp

index 743420b5b80ae7d77c21ab5145f0adff02f00ace..d7b0b64ea979355f3fbe8180323d27b580600675 100644 (file)
@@ -275,7 +275,8 @@ getPointerDependencyFrom(Value *MemPtr, uint64_t MemSize, bool isLoad,
     // 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 ||