Make this more efficient by only making one virtual method call.

llvm-svn: 20793
This commit is contained in:
Chris Lattner 2005-03-23 23:26:58 +00:00
parent 07eac1e698
commit 8424b0f82e
1 changed files with 6 additions and 4 deletions

View File

@ -114,11 +114,13 @@ AliasAnalysis::getModRefInfo(StoreInst *S, Value *P, unsigned Size) {
AliasAnalysis::ModRefResult
AliasAnalysis::getModRefInfo(CallSite CS, Value *P, unsigned Size) {
ModRefResult Mask = ModRef;
if (Function *F = CS.getCalledFunction())
if (onlyReadsMemory(F)) {
if (doesNotAccessMemory(F)) return NoModRef;
if (Function *F = CS.getCalledFunction()) {
ModRefBehavior MRB = getModRefBehavior(F, CallSite());
if (MRB == OnlyReadsMemory)
Mask = Ref;
}
else if (MRB == DoesNotAccessMemory)
return NoModRef;
}
if (!AA) return Mask;