diff options
-rw-r--r-- | lib/Transforms/Scalar/FastDLE.cpp | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/lib/Transforms/Scalar/FastDLE.cpp b/lib/Transforms/Scalar/FastDLE.cpp index 001f834b5f..74712ad83f 100644 --- a/lib/Transforms/Scalar/FastDLE.cpp +++ b/lib/Transforms/Scalar/FastDLE.cpp @@ -69,6 +69,12 @@ bool FDLE::runOnBasicBlock(BasicBlock &BB) { for (BasicBlock::iterator BBI = BB.begin(), BBE = BB.end(); BBI != BBE; ++BBI) { // If we find a store or a free... if (LoadInst* L = dyn_cast<LoadInst>(BBI)) { + // We can't delete volatile loads + if (L->isVolatile()) { + lastLoad[L->getPointerOperand()] = L; + continue; + } + Value* pointer = L->getPointerOperand(); LoadInst*& last = lastLoad[pointer]; |