summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorOwen Anderson <resistor@mac.com>2007-07-23 22:05:54 +0000
committerOwen Anderson <resistor@mac.com>2007-07-23 22:05:54 +0000
commit5e68f0c93d8963f876f971d6c65a354fbef1e8a4 (patch)
tree4cf69a03a3f50e69b9a7a766cadf6d2ae2e22dc1
parent70fce4c6892d8f7dd84b5270f597c052485bdd4d (diff)
downloadbcm5719-llvm-5e68f0c93d8963f876f971d6c65a354fbef1e8a4.tar.gz
bcm5719-llvm-5e68f0c93d8963f876f971d6c65a354fbef1e8a4.zip
Don't delete volatile loads. Doing so is not safe.
llvm-svn: 40448
-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