From: Chris Lattner Date: Mon, 12 Jan 2004 04:13:56 +0000 (+0000) Subject: Do not hack on volatile loads. I'm not sure what the point of a volatile load X-Git-Url: http://plrg.eecs.uci.edu/git/?a=commitdiff_plain;h=5f16a13896f6620638397ab2434f8736412ddcdc;p=oota-llvm.git Do not hack on volatile loads. I'm not sure what the point of a volatile load from constant memory is, but lets not take chances. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@10765 91177308-0d34-0410-b5e6-96231b3b80d8 --- diff --git a/lib/Transforms/Scalar/InstructionCombining.cpp b/lib/Transforms/Scalar/InstructionCombining.cpp index dad78ac81c6..74433d616e8 100644 --- a/lib/Transforms/Scalar/InstructionCombining.cpp +++ b/lib/Transforms/Scalar/InstructionCombining.cpp @@ -2064,6 +2064,8 @@ static Constant *GetGEPGlobalInitializer(Constant *C, ConstantExpr *CE) { Instruction *InstCombiner::visitLoadInst(LoadInst &LI) { Value *Op = LI.getOperand(0); + if (LI.isVolatile()) return 0; + if (ConstantPointerRef *CPR = dyn_cast(Op)) Op = CPR->getValue();