aboutsummaryrefslogtreecommitdiff
path: root/lib/CodeGen/IfConversion.cpp
diff options
context:
space:
mode:
authorJakob Stoklund Olesen <stoklund@2pi.dk>2013-01-24 23:59:08 +0000
committerJakob Stoklund Olesen <stoklund@2pi.dk>2013-01-24 23:59:08 +0000
commitdd4fc446b52cf9e617846c77e2c46e827f1d533e (patch)
tree97cc8f124bc573668c2305eae8e9830ac48e08a8 /lib/CodeGen/IfConversion.cpp
parentb3755e7fa2e386e9bd348eda6b1876ae09c1bf99 (diff)
Avoid creating duplicate CFG edges in the IfConversion pass.
Patch by Stefan Hepp. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@173395 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/CodeGen/IfConversion.cpp')
-rw-r--r--lib/CodeGen/IfConversion.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/lib/CodeGen/IfConversion.cpp b/lib/CodeGen/IfConversion.cpp
index 3583a9b71b..9958d7daad 100644
--- a/lib/CodeGen/IfConversion.cpp
+++ b/lib/CodeGen/IfConversion.cpp
@@ -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);
}