1
0
mirror of https://github.com/RPCS3/llvm-mirror.git synced 2024-11-24 03:33:20 +01:00

Reenable the optimization added in 133415, but change the definition of a "simple" bb to

be one with only one unconditional branch and no phis. Duplicating the phis in this case
is possible, but requeres liveness analysis or breaking edges.

llvm-svn: 133607
This commit is contained in:
Rafael Espindola 2011-06-22 04:01:58 +00:00
parent 376f1d46d4
commit 9cc87c6608

View File

@ -568,9 +568,9 @@ bool
TailDuplicatePass::isSimpleBB(MachineBasicBlock *TailBB) {
if (TailBB->succ_size() != 1)
return false;
MachineBasicBlock::iterator I = TailBB->getFirstNonPHI();
MachineBasicBlock::iterator I = TailBB->begin();
MachineBasicBlock::iterator E = TailBB->end();
while (I->isDebugValue() && I != E)
while (I != E && I->isDebugValue())
++I;
if (I == E)
return true;
@ -712,7 +712,7 @@ TailDuplicatePass::TailDuplicate(MachineBasicBlock *TailBB, MachineFunction &MF,
DenseSet<unsigned> UsedByPhi;
getRegsUsedByPHIs(*TailBB, &UsedByPhi);
if (0 && isSimpleBB(TailBB))
if (isSimpleBB(TailBB))
return duplicateSimpleBB(TailBB, TDBBs, UsedByPhi, Copies);
// Iterate through all the unique predecessors and tail-duplicate this