summaryrefslogtreecommitdiffstats
path: root/llvm/lib/Transforms/Scalar/JumpThreading.cpp
diff options
context:
space:
mode:
authorReid Kleckner <rnk@google.com>2016-03-28 18:07:40 +0000
committerReid Kleckner <rnk@google.com>2016-03-28 18:07:40 +0000
commitba85781f5846d156ff867340a203856aa1957dd6 (patch)
tree9f26256393faeed45a564a00c029a40ac47e5ee2 /llvm/lib/Transforms/Scalar/JumpThreading.cpp
parent6601a4420b3862d6cffc4180c1a7bcd238576be6 (diff)
downloadbcm5719-llvm-ba85781f5846d156ff867340a203856aa1957dd6.tar.gz
bcm5719-llvm-ba85781f5846d156ff867340a203856aa1957dd6.zip
Revert "[SimlifyCFG] Prevent passes from destroying canonical loop structure, especially for nested loops"
This reverts commit r264596. It does not compile. llvm-svn: 264604
Diffstat (limited to 'llvm/lib/Transforms/Scalar/JumpThreading.cpp')
-rw-r--r--llvm/lib/Transforms/Scalar/JumpThreading.cpp5
1 files changed, 1 insertions, 4 deletions
diff --git a/llvm/lib/Transforms/Scalar/JumpThreading.cpp b/llvm/lib/Transforms/Scalar/JumpThreading.cpp
index 2def0b54c6d..c79e756f572 100644
--- a/llvm/lib/Transforms/Scalar/JumpThreading.cpp
+++ b/llvm/lib/Transforms/Scalar/JumpThreading.cpp
@@ -245,13 +245,10 @@ bool JumpThreading::runOnFunction(Function &F) {
// Can't thread an unconditional jump, but if the block is "almost
// empty", we can replace uses of it with uses of the successor and make
// this dead.
- // We should not eliminate the loop header either, because eliminating
- // a loop header might later prevent LoopSimplify from transforming nested
- // loops into simplified form.
if (BI && BI->isUnconditional() &&
BB != &BB->getParent()->getEntryBlock() &&
// If the terminator is the only non-phi instruction, try to nuke it.
- BB->getFirstNonPHIOrDbg()->isTerminator() && !LoopHeaders.count(BB)) {
+ BB->getFirstNonPHIOrDbg()->isTerminator()) {
// Since TryToSimplifyUncondBranchFromEmptyBlock may delete the
// block, we have to make sure it isn't in the LoopHeaders set. We
// reinsert afterward if needed.
OpenPOWER on IntegriCloud