From 774394c68abc88a0d49f207abc1d4da9bd0675b8 Mon Sep 17 00:00:00 2001 From: Chad Rosier Date: Sat, 12 May 2012 00:43:40 +0000 Subject: [PATCH] Hoist simpler checks above llvm::PointerMayBeCaptured. No functional change intended. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@156687 91177308-0d34-0410-b5e6-96231b3b80d8 --- lib/Analysis/MemoryDependenceAnalysis.cpp | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/lib/Analysis/MemoryDependenceAnalysis.cpp b/lib/Analysis/MemoryDependenceAnalysis.cpp index 3a544f35d50..ad891243719 100644 --- a/lib/Analysis/MemoryDependenceAnalysis.cpp +++ b/lib/Analysis/MemoryDependenceAnalysis.cpp @@ -386,15 +386,17 @@ MemoryDependenceAnalysis::getModRefInfo(const Instruction *Inst, // 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(Object)) + if (!isIdentifiedObject(Object) || isa(Object) || + isa(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(Object) || CS.getInstruction() == Object || CB.Captured) + if (CB.Captured) return AliasAnalysis::ModRef; unsigned ArgNo = 0;