summaryrefslogtreecommitdiffstats
path: root/llvm/lib/CodeGen/BranchFolding.cpp
diff options
context:
space:
mode:
authorDale Johannesen <dalej@apple.com>2007-05-24 18:31:55 +0000
committerDale Johannesen <dalej@apple.com>2007-05-24 18:31:55 +0000
commit1409b6a59b0875263b7c2c95808ceaee04fed519 (patch)
tree024b3f7264ec1e05652d0e9a7f49d38122b708e4 /llvm/lib/CodeGen/BranchFolding.cpp
parent1af8c870c74f4a2bf49dfbec220a9e0040f87825 (diff)
downloadbcm5719-llvm-1409b6a59b0875263b7c2c95808ceaee04fed519.tar.gz
bcm5719-llvm-1409b6a59b0875263b7c2c95808ceaee04fed519.zip
Blocks that cond-br and uncond-br/fallthrough to same block should have
only one successor. llvm-svn: 37324
Diffstat (limited to 'llvm/lib/CodeGen/BranchFolding.cpp')
-rw-r--r--llvm/lib/CodeGen/BranchFolding.cpp5
1 files changed, 4 insertions, 1 deletions
diff --git a/llvm/lib/CodeGen/BranchFolding.cpp b/llvm/lib/CodeGen/BranchFolding.cpp
index 6c632c2aee3..1fe2962a365 100644
--- a/llvm/lib/CodeGen/BranchFolding.cpp
+++ b/llvm/lib/CodeGen/BranchFolding.cpp
@@ -672,7 +672,10 @@ static bool CorrectExtraCFGEdges(MachineBasicBlock &MBB,
MachineBasicBlock::pred_iterator SI = MBB.succ_begin();
while (SI != MBB.succ_end()) {
- if (*SI == DestA) {
+ if (*SI == DestA && DestA == DestB) {
+ DestA = DestB = 0;
+ ++SI;
+ } else if (*SI == DestA) {
DestA = 0;
++SI;
} else if (*SI == DestB) {
OpenPOWER on IntegriCloud