summaryrefslogtreecommitdiffstats
path: root/llvm/lib/Transforms
diff options
context:
space:
mode:
Diffstat (limited to 'llvm/lib/Transforms')
-rw-r--r--llvm/lib/Transforms/Scalar/LICM.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/llvm/lib/Transforms/Scalar/LICM.cpp b/llvm/lib/Transforms/Scalar/LICM.cpp
index f2cf68b4e9c..4940566b2a7 100644
--- a/llvm/lib/Transforms/Scalar/LICM.cpp
+++ b/llvm/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;
OpenPOWER on IntegriCloud