summaryrefslogtreecommitdiffstats
path: root/llvm
diff options
context:
space:
mode:
Diffstat (limited to 'llvm')
-rw-r--r--llvm/lib/Transforms/Scalar/FastDLE.cpp6
1 files changed, 6 insertions, 0 deletions
diff --git a/llvm/lib/Transforms/Scalar/FastDLE.cpp b/llvm/lib/Transforms/Scalar/FastDLE.cpp
index 001f834b5f0..74712ad83fe 100644
--- a/llvm/lib/Transforms/Scalar/FastDLE.cpp
+++ b/llvm/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];
OpenPOWER on IntegriCloud