[RegisterCoalescer] Remove copies to reserved registers
authorHal Finkel <hfinkel@anl.gov>
Thu, 15 Jan 2015 01:25:28 +0000 (01:25 +0000)
committerHal Finkel <hfinkel@anl.gov>
Thu, 15 Jan 2015 01:25:28 +0000 (01:25 +0000)
commit47ab8c106f7a29426473947dbb7c714e8126eec5
tree7ce4449e00d14ffe74a390fe80401e22a6cbaf4f
parent4572a0a0a292346dccbf25aeb79668cbdf388d46
[RegisterCoalescer] Remove copies to reserved registers

This allows the RegisterCoalescer to join "non-flipped" range pairs with a
physical destination register -- which allows the RegisterCoalescer to remove
copies like this:

<vreg> = something (maybe a load, for example)
... (things that don't use PHYSREG)
PHYSREG = COPY <vreg>

(with all of the restrictions normally applied by the RegisterCoalescer: having
compatible register classes, etc. )

Previously, the RegisterCoalescer handled only the opposite case (copying
*from* a physical register). I don't handle the problem fully here, but try to
get the common case where there is only one use of <vreg> (the COPY).

An upcoming commit to the PowerPC backend will make this pattern much more
common on PPC64/ELF systems.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@226071 91177308-0d34-0410-b5e6-96231b3b80d8
lib/CodeGen/RegisterCoalescer.cpp
test/CodeGen/ARM/dyn-stackalloc.ll
test/CodeGen/X86/2009-02-12-DebugInfoVLA.ll