aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDevang Patel <dpatel@apple.com>2008-05-15 18:04:29 +0000
committerDevang Patel <dpatel@apple.com>2008-05-15 18:04:29 +0000
commit8dbd9ada3031641e4cc395c5f3806e11e7edaeb7 (patch)
tree67bdf25698f95767f375a10d25f6d47f1aab9508
parentbdb6ca178cfbe2490a058deabce7847a05f55db7 (diff)
Remove useless check.
Patch by Matthijs Kooijman. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@51154 91177308-0d34-0410-b5e6-96231b3b80d8
-rw-r--r--lib/Transforms/Scalar/TailDuplication.cpp8
1 files changed, 2 insertions, 6 deletions
diff --git a/lib/Transforms/Scalar/TailDuplication.cpp b/lib/Transforms/Scalar/TailDuplication.cpp
index c8493b6a5f..8cb28a3b06 100644
--- a/lib/Transforms/Scalar/TailDuplication.cpp
+++ b/lib/Transforms/Scalar/TailDuplication.cpp
@@ -109,13 +109,9 @@ bool TailDup::shouldEliminateUnconditionalBranch(TerminatorInst *TI) {
if (!DTI->use_empty())
return false;
- // Do not bother working on dead blocks...
- pred_iterator PI = pred_begin(Dest), PE = pred_end(Dest);
- if (PI == PE && Dest != Dest->getParent()->begin())
- return false; // It's just a dead block, ignore it...
-
- // Also, do not bother with blocks with only a single predecessor: simplify
+ // Do not bother with blocks with only a single predecessor: simplify
// CFG will fold these two blocks together!
+ pred_iterator PI = pred_begin(Dest), PE = pred_end(Dest);
++PI;
if (PI == PE) return false; // Exactly one predecessor!