summaryrefslogtreecommitdiffstats
path: root/llvm/lib/Transforms
diff options
context:
space:
mode:
authorChris Lattner <sabre@nondot.org>2003-09-08 18:17:14 +0000
committerChris Lattner <sabre@nondot.org>2003-09-08 18:17:14 +0000
commit01a8391236b85c63c89f1c712f5e94e345008587 (patch)
treefbe1343ab036e44cd7e49796bf2d0354fed96b79 /llvm/lib/Transforms
parentc4e76944d7cb1db563b7fb56b6544c20e0bb255c (diff)
downloadbcm5719-llvm-01a8391236b85c63c89f1c712f5e94e345008587.tar.gz
bcm5719-llvm-01a8391236b85c63c89f1c712f5e94e345008587.zip
Do not hoist volatile loads
llvm-svn: 8399
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