Resolve conflicts involving dead vector lanes for -new-coalescer.
authorJakob Stoklund Olesen <stoklund@2pi.dk>
Wed, 19 Sep 2012 21:29:18 +0000 (21:29 +0000)
committerJakob Stoklund Olesen <stoklund@2pi.dk>
Wed, 19 Sep 2012 21:29:18 +0000 (21:29 +0000)
commitd40d4c34f72d1eda3cd9ba0f3dbf2d43b726f06c
treee52536a598a4ccea765d0cef7d8ad86530fff015
parentbbf628b6cefc8d817eb9ec04c2a357ad3f27d618
Resolve conflicts involving dead vector lanes for -new-coalescer.

A common coalescing conflict in vector code is lane insertion:

  %dst = FOO
  %src = BAR
  %dst:ssub0 = COPY %src

The live range of %src interferes with the ssub0 lane of %dst, but that
lane is never read after %src would have clobbered it. That makes it
safe to merge the live ranges and eliminate the COPY:

  %dst = FOO
  %dst:ssub0 = BAR

This patch teaches the new coalescer to resolve conflicts where dead
vector lanes would be clobbered, at least as long as the clobbered
vector lanes don't escape the basic block.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@164250 91177308-0d34-0410-b5e6-96231b3b80d8
lib/CodeGen/RegisterCoalescer.cpp
test/CodeGen/ARM/coalesce-subregs.ll