From 9b96ecaffa38a21eaca81c51153475152f44d8a7 Mon Sep 17 00:00:00 2001 From: Chris Lattner Date: Tue, 22 Dec 2009 01:00:32 +0000 Subject: [PATCH] avoid calling extractMallocCall when it's obvious we don't have 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 | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/lib/Analysis/MemoryDependenceAnalysis.cpp b/lib/Analysis/MemoryDependenceAnalysis.cpp index 743420b5b80..d7b0b64ea97 100644 --- a/lib/Analysis/MemoryDependenceAnalysis.cpp +++ b/lib/Analysis/MemoryDependenceAnalysis.cpp @@ -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(Inst) || extractMallocCall(Inst)) { + if (isa(Inst) || + (isa(Inst) && extractMallocCall(Inst))) { Value *AccessPtr = MemPtr->getUnderlyingObject(); if (AccessPtr == Inst || -- 2.34.1