forked from OSchip/llvm-project
Make this more efficient by only making one virtual method call.
llvm-svn: 20793
This commit is contained in:
parent
07eac1e698
commit
8424b0f82e
|
@ -114,10 +114,12 @@ 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;
|
||||
|
|
Loading…
Reference in New Issue