From 4797e58d6b41aa7f04b01c98a83f81bd2014eeb6 Mon Sep 17 00:00:00 2001 From: Jakob Stoklund Olesen Date: Wed, 18 Nov 2009 00:02:18 +0000 Subject: Fix inverted test and add testcase from failing self-host. llvm-svn: 89167 --- llvm/lib/CodeGen/PHIElimination.cpp | 16 +++++++--------- 1 file changed, 7 insertions(+), 9 deletions(-) (limited to 'llvm/lib/CodeGen/PHIElimination.cpp') diff --git a/llvm/lib/CodeGen/PHIElimination.cpp b/llvm/lib/CodeGen/PHIElimination.cpp index 948511c5fb1..cd38dd144c5 100644 --- a/llvm/lib/CodeGen/PHIElimination.cpp +++ b/llvm/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 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 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 Cond; + Cond.clear(); MF->getTarget().getInstrInfo()->InsertBranch(*NMBB, B, NULL, Cond); // Fix PHI nodes in B so they refer to NMBB instead of A -- cgit v1.2.3