aboutsummaryrefslogtreecommitdiff
path: root/lib/Transforms/Scalar/Reassociate.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'lib/Transforms/Scalar/Reassociate.cpp')
-rw-r--r--lib/Transforms/Scalar/Reassociate.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/lib/Transforms/Scalar/Reassociate.cpp b/lib/Transforms/Scalar/Reassociate.cpp
index 4212e6ae69..df0a64188f 100644
--- a/lib/Transforms/Scalar/Reassociate.cpp
+++ b/lib/Transforms/Scalar/Reassociate.cpp
@@ -74,7 +74,7 @@ unsigned Reassociate::getRank(Value *V) {
if (I->getOpcode() == Instruction::PHINode ||
I->getOpcode() == Instruction::Alloca ||
I->getOpcode() == Instruction::Malloc || isa<TerminatorInst>(I) ||
- I->hasSideEffects())
+ I->mayWriteToMemory()) // Cannot move inst if it writes to memory!
return RankMap[I->getParent()];
unsigned &CachedRank = InstRankMap[I];