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)
commit82d77e81457ffeaeb2144ab3a08cb3f3e7466eaa
tree72fb7630d8b0262a7d5659fb2d31cec16a6f58c7
parente5bbe37950191462794fde6de4703e7d664dbf67
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.

llvm-svn: 157101
llvm/lib/CodeGen/LiveInterval.cpp
llvm/lib/CodeGen/RegisterCoalescer.cpp