Hoist simpler checks above llvm::PointerMayBeCaptured. No functional change intended.

llvm-svn: 156687
This commit is contained in:
Chad Rosier 2012-05-12 00:43:40 +00:00
parent aff911c34c
commit f276b2009c

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;