aboutsummaryrefslogtreecommitdiff
path: root/lib/Transforms
diff options
context:
space:
mode:
authorChris Lattner <sabre@nondot.org>2004-01-12 04:13:56 +0000
committerChris Lattner <sabre@nondot.org>2004-01-12 04:13:56 +0000
commit5f16a13896f6620638397ab2434f8736412ddcdc (patch)
tree74448804ebd450e5fae322059f90c50b6605fe7b /lib/Transforms
parent1daee8b010003e8578824877f0dbe407b554b52d (diff)
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
Diffstat (limited to 'lib/Transforms')
-rw-r--r--lib/Transforms/Scalar/InstructionCombining.cpp2
1 files changed, 2 insertions, 0 deletions
diff --git a/lib/Transforms/Scalar/InstructionCombining.cpp b/lib/Transforms/Scalar/InstructionCombining.cpp
index dad78ac81c..74433d616e 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<ConstantPointerRef>(Op))
Op = CPR->getValue();