mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-02-22 13:29:44 +00:00
Re enable 133415 with two fixes
* Don't introduce a duplicated bb in the CFG * When making a branch unconditional, clear the PredCond array so that it is really unconditional. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@133432 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
parent
2ee2d93232
commit
689c24768b
@ -669,8 +669,10 @@ TailDuplicatePass::duplicateSimpleBB(MachineBasicBlock *TailBB,
|
|||||||
PredTBB = NewTarget;
|
PredTBB = NewTarget;
|
||||||
|
|
||||||
// Make the branch unconditional if possible
|
// Make the branch unconditional if possible
|
||||||
if (PredTBB == PredFBB)
|
if (PredTBB == PredFBB) {
|
||||||
|
PredCond.clear();
|
||||||
PredFBB = NULL;
|
PredFBB = NULL;
|
||||||
|
}
|
||||||
|
|
||||||
// Avoid adding fall through branches.
|
// Avoid adding fall through branches.
|
||||||
if (PredFBB == NextBB)
|
if (PredFBB == NextBB)
|
||||||
@ -684,6 +686,9 @@ TailDuplicatePass::duplicateSimpleBB(MachineBasicBlock *TailBB,
|
|||||||
TII->InsertBranch(*PredBB, PredTBB, PredFBB, PredCond, DebugLoc());
|
TII->InsertBranch(*PredBB, PredTBB, PredFBB, PredCond, DebugLoc());
|
||||||
|
|
||||||
PredBB->removeSuccessor(TailBB);
|
PredBB->removeSuccessor(TailBB);
|
||||||
|
unsigned NumSuccessors = PredBB->succ_size();
|
||||||
|
assert(NumSuccessors <= 1);
|
||||||
|
if (NumSuccessors == 0 || *PredBB->succ_begin() != NewTarget)
|
||||||
PredBB->addSuccessor(NewTarget);
|
PredBB->addSuccessor(NewTarget);
|
||||||
|
|
||||||
TDBBs.push_back(PredBB);
|
TDBBs.push_back(PredBB);
|
||||||
@ -707,7 +712,7 @@ TailDuplicatePass::TailDuplicate(MachineBasicBlock *TailBB, MachineFunction &MF,
|
|||||||
DenseSet<unsigned> UsedByPhi;
|
DenseSet<unsigned> UsedByPhi;
|
||||||
getRegsUsedByPHIs(*TailBB, &UsedByPhi);
|
getRegsUsedByPHIs(*TailBB, &UsedByPhi);
|
||||||
|
|
||||||
if (0 && isSimpleBB(TailBB)) // Disabled to see if doing so fixes buildbots.
|
if (isSimpleBB(TailBB))
|
||||||
return duplicateSimpleBB(TailBB, TDBBs, UsedByPhi, Copies);
|
return duplicateSimpleBB(TailBB, TDBBs, UsedByPhi, Copies);
|
||||||
|
|
||||||
// Iterate through all the unique predecessors and tail-duplicate this
|
// Iterate through all the unique predecessors and tail-duplicate this
|
||||||
|
Loading…
x
Reference in New Issue
Block a user