Run proper recursive dead code elimination during coalescing.
authorJakob Stoklund Olesen <stoklund@2pi.dk>
Sat, 19 May 2012 05:25:50 +0000 (05:25 +0000)
committerJakob Stoklund Olesen <stoklund@2pi.dk>
Sat, 19 May 2012 05:25:50 +0000 (05:25 +0000)
commitbd6f44a3a2a1404721bcbb67edf92b8480a3e655
tree490f7e83e476f9d5f4f77205f3a0113c19d3ddd0
parent20942dcd8634ad75091fe89669868cfebf74e869
Run proper recursive dead code elimination during coalescing.

Dead copies cause problems because they are trivial to coalesce, but
removing them gived the live range a dangling end point. This patch
enables full dead code elimination which trims live ranges to their uses
so end points don't dangle.

DCE may erase multiple instructions. Put the pointers in an ErasedInstrs
set so we never risk visiting erased instructions in the work list.

There isn't supposed to be any dead copies entering RegisterCoalescer,
but they do slip by as evidenced by test/CodeGen/X86/coalescer-dce.ll.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@157101 91177308-0d34-0410-b5e6-96231b3b80d8
lib/CodeGen/LiveInterval.cpp
lib/CodeGen/RegisterCoalescer.cpp