Added a late machine instruction copy propagation pass. This catches

opportunities that only present themselves after late optimizations
such as tail duplication .e.g.
## BB#1:
        movl    %eax, %ecx
        movl    %ecx, %eax
        ret

The register allocator also leaves some of them around (due to false
dep between copies from phi-elimination, etc.)

This required some changes in codegen passes. Post-ra scheduler and the
pseudo-instruction expansion passes have been moved after branch folding
and tail merging. They were before branch folding before because it did
not always update block livein's. That's fixed now. The pass change makes
independently since we want to properly schedule instructions after
branch folding / tail duplication.

rdar://10428165
rdar://10640363



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@147716 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
Evan Cheng
2012-01-07 03:02:36 +00:00
parent ccec74738d
commit 977679d603
13 changed files with 318 additions and 41 deletions

View File

@@ -120,11 +120,6 @@ namespace llvm {
///
LoopDependencies LoopRegs;
/// LoopLiveInRegs - Track which regs are live into a loop, to help guide
/// back-edge-aware scheduling.
///
SmallSet<unsigned, 8> LoopLiveInRegs;
protected:
/// DbgValues - Remember instruction that preceeds DBG_VALUE.