diff options
author | Chris Lattner <sabre@nondot.org> | 2003-09-08 18:17:14 +0000 |
---|---|---|
committer | Chris Lattner <sabre@nondot.org> | 2003-09-08 18:17:14 +0000 |
commit | 01a8391236b85c63c89f1c712f5e94e345008587 (patch) | |
tree | fbe1343ab036e44cd7e49796bf2d0354fed96b79 /llvm/lib/Transforms/Scalar/LICM.cpp | |
parent | c4e76944d7cb1db563b7fb56b6544c20e0bb255c (diff) | |
download | bcm5719-llvm-01a8391236b85c63c89f1c712f5e94e345008587.tar.gz bcm5719-llvm-01a8391236b85c63c89f1c712f5e94e345008587.zip |
Do not hoist volatile loads
llvm-svn: 8399
Diffstat (limited to 'llvm/lib/Transforms/Scalar/LICM.cpp')
-rw-r--r-- | llvm/lib/Transforms/Scalar/LICM.cpp | 2 |
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; |