diff options
author | Bjorn Steinbrink <bsteinbr@gmail.com> | 2015-08-20 08:58:47 +0000 |
---|---|---|
committer | Bjorn Steinbrink <bsteinbr@gmail.com> | 2015-08-20 08:58:47 +0000 |
commit | 2e2f66557e592d1fb524197afdfe24abf48db42d (patch) | |
tree | 75576ea1f67340da9a87b46d5b702f35d8ad32cd /llvm/lib/Transforms | |
parent | cc7e8a9705fc9cdd5bc19324c5194ad26e40959b (diff) | |
download | bcm5719-llvm-2e2f66557e592d1fb524197afdfe24abf48db42d.tar.gz bcm5719-llvm-2e2f66557e592d1fb524197afdfe24abf48db42d.zip |
Revert "[DSE] Enable removal of lifetime intrinsics in terminating blocks"
llvm-svn: 245543
Diffstat (limited to 'llvm/lib/Transforms')
-rw-r--r-- | llvm/lib/Transforms/Scalar/DeadStoreElimination.cpp | 33 |
1 files changed, 3 insertions, 30 deletions
diff --git a/llvm/lib/Transforms/Scalar/DeadStoreElimination.cpp b/llvm/lib/Transforms/Scalar/DeadStoreElimination.cpp index d64c5d24fc8..c8b0ea8c992 100644 --- a/llvm/lib/Transforms/Scalar/DeadStoreElimination.cpp +++ b/llvm/lib/Transforms/Scalar/DeadStoreElimination.cpp @@ -788,33 +788,15 @@ bool DSE::handleEndBlock(BasicBlock &BB) { const DataLayout &DL = BB.getModule()->getDataLayout(); - // becomes false once lifetime intrinsics are observable or useful for stack - // coloring - bool canRemoveLifetimeIntrinsics = true; - // Scan the basic block backwards for (BasicBlock::iterator BBI = BB.end(); BBI != BB.begin(); ){ --BBI; - Value *V = nullptr; - if (canRemoveLifetimeIntrinsics) - if (IntrinsicInst *II = dyn_cast<IntrinsicInst>(BBI)) - switch (II->getIntrinsicID()) { - default: break; - case Intrinsic::lifetime_start: - case Intrinsic::lifetime_end: - V = II->getArgOperand(1); - break; - } - - if (!V && hasMemoryWrite(BBI, *TLI) && isRemovable(BBI)) - V = getStoredPointerOperand(BBI); - - // If we found a store, check to see if it points into a dead stack value. - if (V) { + // If we find a store, check to see if it points into a dead stack value. + if (hasMemoryWrite(BBI, *TLI) && isRemovable(BBI)) { // See through pointer-to-pointer bitcasts SmallVector<Value *, 4> Pointers; - GetUnderlyingObjects(V, Pointers, DL); + GetUnderlyingObjects(getStoredPointerOperand(BBI), Pointers, DL); // Stores to stack values are valid candidates for removal. bool AllDead = true; @@ -862,15 +844,6 @@ bool DSE::handleEndBlock(BasicBlock &BB) { continue; } - if (IntrinsicInst *II = dyn_cast<IntrinsicInst>(BBI)) - if (II->getIntrinsicID() == Intrinsic::lifetime_start) { - // We found a lifetime start for a live object, which we could not - // remove. So we must stop removing lifetime intrinsics from this block - // because they're useful for stack coloring again - canRemoveLifetimeIntrinsics = false; - continue; - } - if (auto CS = CallSite(BBI)) { // Remove allocation function calls from the list of dead stack objects; // there can't be any references before the definition. |