diff options
author | Eli Friedman <eli.friedman@gmail.com> | 2011-07-27 01:08:30 +0000 |
---|---|---|
committer | Eli Friedman <eli.friedman@gmail.com> | 2011-07-27 01:08:30 +0000 |
commit | 89b694b09652e6923d26c57038cfa94c01c43a53 (patch) | |
tree | a9d5d7307b044fbd3241e13816cf0ed7ae86d37d /llvm/lib/Transforms/Scalar/DeadStoreElimination.cpp | |
parent | 538482373bba8f268b179eabde85652f630af826 (diff) | |
download | bcm5719-llvm-89b694b09652e6923d26c57038cfa94c01c43a53.tar.gz bcm5719-llvm-89b694b09652e6923d26c57038cfa94c01c43a53.zip |
Misc mid-level changes for new 'fence' instruction.
llvm-svn: 136205
Diffstat (limited to 'llvm/lib/Transforms/Scalar/DeadStoreElimination.cpp')
-rw-r--r-- | llvm/lib/Transforms/Scalar/DeadStoreElimination.cpp | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/llvm/lib/Transforms/Scalar/DeadStoreElimination.cpp b/llvm/lib/Transforms/Scalar/DeadStoreElimination.cpp index e6089a9a432..a645f921162 100644 --- a/llvm/lib/Transforms/Scalar/DeadStoreElimination.cpp +++ b/llvm/lib/Transforms/Scalar/DeadStoreElimination.cpp @@ -665,7 +665,7 @@ bool DSE::handleEndBlock(BasicBlock &BB) { continue; } - + AliasAnalysis::Location LoadedLoc; // If we encounter a use of the pointer, it is no longer considered dead @@ -675,9 +675,12 @@ bool DSE::handleEndBlock(BasicBlock &BB) { LoadedLoc = AA->getLocation(V); } else if (MemTransferInst *MTI = dyn_cast<MemTransferInst>(BBI)) { LoadedLoc = AA->getLocationForSource(MTI); - } else { - // Not a loading instruction. + } else if (!BBI->mayReadOrWriteMemory()) { + // Instruction doesn't touch memory. continue; + } else { + // Unknown inst; assume it clobbers everything. + break; } // Remove any allocas from the DeadPointer set that are loaded, as this |