From: Chris Lattner Date: Mon, 8 Sep 2003 18:17:14 +0000 (+0000) Subject: Do not hoist volatile loads X-Git-Url: http://demsky.eecs.uci.edu/git/?a=commitdiff_plain;h=61c1e7e32def2978441c699dcf9943dbe14aad98;p=oota-llvm.git Do not hoist volatile loads git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@8399 91177308-0d34-0410-b5e6-96231b3b80d8 --- diff --git a/lib/Transforms/Scalar/LICM.cpp b/lib/Transforms/Scalar/LICM.cpp index f2cf68b4e9c..4940566b2a7 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;