aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--lib/Transforms/Scalar/LICM.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/lib/Transforms/Scalar/LICM.cpp b/lib/Transforms/Scalar/LICM.cpp
index f2cf68b..4940566 100644
--- a/lib/Transforms/Scalar/LICM.cpp
+++ b/lib/Transforms/Scalar/LICM.cpp
@@ -316,7 +316,7 @@ bool LICM::SafeToHoist(Instruction &Inst) {
void LICM::visitLoadInst(LoadInst &LI) {
- if (isLoopInvariant(LI.getOperand(0)) &&
+ if (isLoopInvariant(LI.getOperand(0)) && !LI.isVolatile() &&
!pointerInvalidatedByLoop(LI.getOperand(0)) && SafeToHoist(LI)) {
hoist(LI);
++NumHoistedLoads;