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
This commit is contained in:
Chad Rosier 2012-05-12 00:43:40 +00:00
parent 2b3fa322b8
commit 774394c68a

View File

@ -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<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;