Avoid creating duplicate CFG edges in the IfConversion pass.

Patch by Stefan Hepp.

llvm-svn: 173395
This commit is contained in:
Jakob Stoklund Olesen 2013-01-24 23:59:08 +00:00
parent efde585fc3
commit 708eb476f0

View File

@ -1557,7 +1557,7 @@ void IfConverter::MergeBlocks(BBInfo &ToBBI, BBInfo &FromBBI, bool AddEdges) {
if (Succ == FallThrough)
continue;
FromBBI.BB->removeSuccessor(Succ);
if (AddEdges)
if (AddEdges && !ToBBI.BB->isSuccessor(Succ))
ToBBI.BB->addSuccessor(Succ);
}