Tail duplication still needs to iterate. Duplicating new instructions onto

the tail of a block may make that block a new candidate for duplication.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@89264 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
Bob Wilson
2009-11-18 22:52:37 +00:00
parent 79d621035e
commit 60f34b9fb0
2 changed files with 71 additions and 3 deletions

View File

@@ -197,7 +197,6 @@ bool BranchFolder::OptimizeFunction(MachineFunction &MF,
MadeChange |= OptimizeImpDefsBlock(MBB);
}
bool MadeChangeThisIteration = true;
while (MadeChangeThisIteration) {
MadeChangeThisIteration = false;
@@ -206,10 +205,15 @@ bool BranchFolder::OptimizeFunction(MachineFunction &MF,
MadeChange |= MadeChangeThisIteration;
}
// Do tail duplication once after tail merging is done. Otherwise it is
// Do tail duplication after tail merging is done. Otherwise it is
// tough to avoid situations where tail duplication and tail merging undo
// each other's transformations ad infinitum.
MadeChange |= TailDuplicateBlocks(MF);
MadeChangeThisIteration = true;
while (MadeChangeThisIteration) {
MadeChangeThisIteration = false;
MadeChangeThisIteration |= TailDuplicateBlocks(MF);
MadeChange |= MadeChangeThisIteration;
}
// See if any jump tables have become mergable or dead as the code generator
// did its thing.