[llvm-commits] CVS: llvm/lib/Transforms/Scalar/InstructionCombining.cpp

Chris Lattner lattner at cs.uiuc.edu
Sun Jan 11 22:15:01 PST 2004


Changes in directory llvm/lib/Transforms/Scalar:

InstructionCombining.cpp updated: 1.145 -> 1.146

---
Log message:

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.


---
Diffs of the changes:  (+2 -0)

Index: llvm/lib/Transforms/Scalar/InstructionCombining.cpp
diff -u llvm/lib/Transforms/Scalar/InstructionCombining.cpp:1.145 llvm/lib/Transforms/Scalar/InstructionCombining.cpp:1.146
--- llvm/lib/Transforms/Scalar/InstructionCombining.cpp:1.145	Thu Dec 18 23:58:40 2003
+++ llvm/lib/Transforms/Scalar/InstructionCombining.cpp	Sun Jan 11 22:13:56 2004
@@ -2064,6 +2064,8 @@
 
 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();
 





More information about the llvm-commits mailing list