diff options
author | Owen Anderson <resistor@mac.com> | 2007-07-23 22:05:54 +0000 |
---|---|---|
committer | Owen Anderson <resistor@mac.com> | 2007-07-23 22:05:54 +0000 |
commit | 6b8894bb67d9f3a0940ac888ec56ac40e5d6c17a (patch) | |
tree | 2b7674f7883ae7953cc2e80ff0516536cbaabf53 | |
parent | fb80b6e056f3bf8e82eba131220b1dfc8f80f5a0 (diff) |
Don't delete volatile loads. Doing so is not safe.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@40448 91177308-0d34-0410-b5e6-96231b3b80d8
-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]; |