diff options
author | Chris Lattner <sabre@nondot.org> | 2008-11-28 19:54:49 +0000 |
---|---|---|
committer | Chris Lattner <sabre@nondot.org> | 2008-11-28 19:54:49 +0000 |
commit | 8a172daa55c261eb378697d98eb2c0d8a2af4b9c (patch) | |
tree | 11974bd8bafdd04f7ae083bcdf7daa6360611609 /llvm/lib/Transforms/Scalar/JumpThreading.cpp | |
parent | 71ecd67b5d87207fca79d120dbf1feae157ddc47 (diff) | |
download | bcm5719-llvm-8a172daa55c261eb378697d98eb2c0d8a2af4b9c.tar.gz bcm5719-llvm-8a172daa55c261eb378697d98eb2c0d8a2af4b9c.zip |
don't call MergeBasicBlockIntoOnlyPred on a block whose only
predecessor is itself. This doesn't make sense, and this is
a dead infinite loop anyway.
llvm-svn: 60210
Diffstat (limited to 'llvm/lib/Transforms/Scalar/JumpThreading.cpp')
-rw-r--r-- | llvm/lib/Transforms/Scalar/JumpThreading.cpp | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/llvm/lib/Transforms/Scalar/JumpThreading.cpp b/llvm/lib/Transforms/Scalar/JumpThreading.cpp index 5de5fb3b776..114603dabb0 100644 --- a/llvm/lib/Transforms/Scalar/JumpThreading.cpp +++ b/llvm/lib/Transforms/Scalar/JumpThreading.cpp @@ -164,7 +164,8 @@ bool JumpThreading::ProcessBlock(BasicBlock *BB) { // because now the condition in this block can be threaded through // predecessors of our predecessor block. if (BasicBlock *SinglePred = BB->getSinglePredecessor()) - if (SinglePred->getTerminator()->getNumSuccessors() == 1) { + if (SinglePred->getTerminator()->getNumSuccessors() == 1 && + SinglePred != BB) { // Remember if SinglePred was the entry block of the function. If so, we // will need to move BB back to the entry position. bool isEntry = SinglePred == &SinglePred->getParent()->getEntryBlock(); |