mirror of
https://github.com/RPCS3/llvm-mirror.git
synced 2025-01-24 21:05:23 +00:00
Fix bug: TailDup/2003-07-22-InfiniteLoop.ll
llvm-svn: 7243
This commit is contained in:
parent
5ff1500e85
commit
74a266d229
@ -76,6 +76,11 @@ bool TailDup::shouldEliminateUnconditionalBranch(TerminatorInst *TI) {
|
||||
BasicBlock *Dest = BI->getSuccessor(0);
|
||||
if (Dest == BI->getParent()) return false; // Do not loop infinitely!
|
||||
|
||||
// Do not inline a block if we will just get another branch to the same block!
|
||||
if (BranchInst *DBI = dyn_cast<BranchInst>(Dest->getTerminator()))
|
||||
if (DBI->isUnconditional() && DBI->getSuccessor(0) == Dest)
|
||||
return false; // Do not loop infinitely!
|
||||
|
||||
// Do not bother working on dead blocks...
|
||||
pred_iterator PI = pred_begin(Dest), PE = pred_end(Dest);
|
||||
if (PI == PE && Dest != Dest->getParent()->begin())
|
||||
|
Loading…
x
Reference in New Issue
Block a user