summaryrefslogtreecommitdiff
path: root/lib/CodeGen/PHIElimination.cpp
diff options
context:
space:
mode:
authorJakob Stoklund Olesen <stoklund@2pi.dk>2009-11-18 00:02:18 +0000
committerJakob Stoklund Olesen <stoklund@2pi.dk>2009-11-18 00:02:18 +0000
commit5052c1547ef75f401fd397084831e0bb15311b09 (patch)
tree1fbe0ad8b23cf1c24a5140ec5a00b2fce6aba870 /lib/CodeGen/PHIElimination.cpp
parent427ef4e35f16af0509f8217bed07eba745e83a9f (diff)
downloadllvm-5052c1547ef75f401fd397084831e0bb15311b09.tar.gz
llvm-5052c1547ef75f401fd397084831e0bb15311b09.tar.bz2
llvm-5052c1547ef75f401fd397084831e0bb15311b09.tar.xz
Fix inverted test and add testcase from failing self-host.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@89167 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/CodeGen/PHIElimination.cpp')
-rw-r--r--lib/CodeGen/PHIElimination.cpp16
1 files changed, 7 insertions, 9 deletions
diff --git a/lib/CodeGen/PHIElimination.cpp b/lib/CodeGen/PHIElimination.cpp
index 948511c5fb..cd38dd144c 100644
--- a/lib/CodeGen/PHIElimination.cpp
+++ b/lib/CodeGen/PHIElimination.cpp
@@ -449,14 +449,12 @@ MachineBasicBlock *PHIElimination::SplitCriticalEdge(MachineBasicBlock *A,
MachineFunction *MF = A->getParent();
// We may need to update A's terminator, but we can't do that if AnalyzeBranch
- // fails.
- if (A->isLayoutSuccessor(B)) {
- const TargetInstrInfo *TII = MF->getTarget().getInstrInfo();
- MachineBasicBlock *TBB = 0, *FBB = 0;
- SmallVector<MachineOperand, 4> Cond;
- if (!TII->AnalyzeBranch(*A, TBB, FBB, Cond))
- return NULL;
- }
+ // fails. If A uses a jump table, we won't touch it.
+ const TargetInstrInfo *TII = MF->getTarget().getInstrInfo();
+ MachineBasicBlock *TBB = 0, *FBB = 0;
+ SmallVector<MachineOperand, 4> Cond;
+ if (TII->AnalyzeBranch(*A, TBB, FBB, Cond))
+ return NULL;
++NumSplits;
@@ -474,7 +472,7 @@ MachineBasicBlock *PHIElimination::SplitCriticalEdge(MachineBasicBlock *A,
// Insert unconditional "jump B" instruction in NMBB.
NMBB->addSuccessor(B);
- SmallVector<MachineOperand, 4> Cond;
+ Cond.clear();
MF->getTarget().getInstrInfo()->InsertBranch(*NMBB, B, NULL, Cond);
// Fix PHI nodes in B so they refer to NMBB instead of A