Fix bug: InstCombine/2003-09-09-VolatileLoadElim.ll
authorChris Lattner <sabre@nondot.org>
Tue, 9 Sep 2003 18:16:08 +0000 (18:16 +0000)
committerChris Lattner <sabre@nondot.org>
Tue, 9 Sep 2003 18:16:08 +0000 (18:16 +0000)
Loads "mayWriteToMemory" if they are volatile

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@8422 91177308-0d34-0410-b5e6-96231b3b80d8

include/llvm/iMemory.h

index 4cc76e46d7a741f1aa7dc36cc4179ad5327c07f5..d3dd9fd811694c93ba7634b42018a44ecf42f995 100644 (file)
@@ -159,6 +159,8 @@ public:
 
   virtual Instruction *clone() const { return new LoadInst(*this); }
 
+  virtual bool mayWriteToMemory() const { return isVolatile(); }
+
   Value *getPointerOperand() { return getOperand(0); }
   const Value *getPointerOperand() const { return getOperand(0); }
   static unsigned getPointerOperandIndex() { return 0U; }