diff options
author | Dan Gohman <gohman@apple.com> | 2009-05-05 21:10:19 +0000 |
---|---|---|
committer | Dan Gohman <gohman@apple.com> | 2009-05-05 21:10:19 +0000 |
commit | bb2f10759ee101a3fed1a5752f7ff4751faba573 (patch) | |
tree | 1738aa7eb401477169b2ed8e62a193fcc8af71c5 /llvm/lib/CodeGen/IfConversion.cpp | |
parent | 1eb40dad172a848bc17d7876186cd9054500de17 (diff) | |
download | bcm5719-llvm-bb2f10759ee101a3fed1a5752f7ff4751faba573.tar.gz bcm5719-llvm-bb2f10759ee101a3fed1a5752f7ff4751faba573.zip |
If a MachineBasicBlock has multiple ways of reaching another block,
allow it to have multiple CFG edges to that block. This is needed
to allow MachineBasicBlock::isOnlyReachableByFallthrough to work
correctly. This fixes PR4126.
llvm-svn: 71018
Diffstat (limited to 'llvm/lib/CodeGen/IfConversion.cpp')
-rw-r--r-- | llvm/lib/CodeGen/IfConversion.cpp | 8 |
1 files changed, 3 insertions, 5 deletions
diff --git a/llvm/lib/CodeGen/IfConversion.cpp b/llvm/lib/CodeGen/IfConversion.cpp index 8d212a606fd..b9ee23ae9bd 100644 --- a/llvm/lib/CodeGen/IfConversion.cpp +++ b/llvm/lib/CodeGen/IfConversion.cpp @@ -1174,8 +1174,7 @@ void IfConverter::CopyAndPredicateBlock(BBInfo &ToBBI, BBInfo &FromBBI, // Fallthrough edge can't be transferred. if (Succ == FallThrough) continue; - if (!ToBBI.BB->isSuccessor(Succ)) - ToBBI.BB->addSuccessor(Succ); + ToBBI.BB->addSuccessor(Succ); } std::copy(FromBBI.Predicate.begin(), FromBBI.Predicate.end(), @@ -1215,12 +1214,11 @@ void IfConverter::MergeBlocks(BBInfo &ToBBI, BBInfo &FromBBI) { if (Succ == FallThrough) continue; FromBBI.BB->removeSuccessor(Succ); - if (!ToBBI.BB->isSuccessor(Succ)) - ToBBI.BB->addSuccessor(Succ); + ToBBI.BB->addSuccessor(Succ); } // Now FromBBI always fall through to the next block! - if (NBB && !FromBBI.BB->isSuccessor(NBB)) + if (NBB) FromBBI.BB->addSuccessor(NBB); std::copy(FromBBI.Predicate.begin(), FromBBI.Predicate.end(), |