From 61c1e7e32def2978441c699dcf9943dbe14aad98 Mon Sep 17 00:00:00 2001 From: Chris Lattner Date: Mon, 8 Sep 2003 18:17:14 +0000 Subject: [PATCH] Do not hoist volatile loads git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@8399 91177308-0d34-0410-b5e6-96231b3b80d8 --- lib/Transforms/Scalar/LICM.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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; -- 2.34.1