diff options
| author | Bob Wilson <bob.wilson@apple.com> | 2009-11-18 22:52:37 +0000 |
|---|---|---|
| committer | Bob Wilson <bob.wilson@apple.com> | 2009-11-18 22:52:37 +0000 |
| commit | 108aadf972b1dd495d4e08323a4568238b646553 (patch) | |
| tree | 10c468fa9d3ba6c1cd9212950003f857d93cc689 /llvm/lib/CodeGen | |
| parent | 1f82f2462de797fe08587aa8e49d968fe6877efd (diff) | |
| download | bcm5719-llvm-108aadf972b1dd495d4e08323a4568238b646553.tar.gz bcm5719-llvm-108aadf972b1dd495d4e08323a4568238b646553.zip | |
Tail duplication still needs to iterate. Duplicating new instructions onto
the tail of a block may make that block a new candidate for duplication.
llvm-svn: 89264
Diffstat (limited to 'llvm/lib/CodeGen')
| -rw-r--r-- | llvm/lib/CodeGen/BranchFolding.cpp | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/llvm/lib/CodeGen/BranchFolding.cpp b/llvm/lib/CodeGen/BranchFolding.cpp index af5fbd1202a..871d6dc5765 100644 --- a/llvm/lib/CodeGen/BranchFolding.cpp +++ b/llvm/lib/CodeGen/BranchFolding.cpp @@ -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. |

