aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--lib/Transforms/Scalar/LICM.cpp5
1 files changed, 3 insertions, 2 deletions
diff --git a/lib/Transforms/Scalar/LICM.cpp b/lib/Transforms/Scalar/LICM.cpp
index c20e179f10..15c98a5393 100644
--- a/lib/Transforms/Scalar/LICM.cpp
+++ b/lib/Transforms/Scalar/LICM.cpp
@@ -358,9 +358,10 @@ bool LICM::canSinkOrHoistInst(Instruction &I) {
} else if (CallInst *CI = dyn_cast<CallInst>(&I)) {
// Handle obvious cases efficiently.
if (Function *Callee = CI->getCalledFunction()) {
- if (AA->doesNotAccessMemory(Callee))
+ AliasAnalysis::ModRefBehavior Behavior =AA->getModRefBehavior(Callee, CI);
+ if (Behavior == AliasAnalysis::DoesNotAccessMemory)
return true;
- else if (AA->onlyReadsMemory(Callee)) {
+ else if (Behavior == AliasAnalysis::OnlyReadsMemory) {
// If this call only reads from memory and there are no writes to memory
// in the loop, we can hoist or sink the call as appropriate.
bool FoundMod = false;