[PATCH] Allow the RegisterCoalescer to remove copies to reserved registers

hfinkel at anl.gov hfinkel at anl.gov
Wed Jan 14 14:31:16 PST 2015

Hi qcolombet, atrick, MatzeB,

Hi everyone,

Please review this patch that allows the RegisterCoalescer to join "non-flipped" range pairs with a physical destination register. This allows the RegisterCoalescer to remove copies like this:

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

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

Currently, RegisterCoalescer handles 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).

One thing that is not clear to me: Do I need to do anything special to update the 'dead def' live range corresponding to the updated PHYSREG?

Once this functionality is committed, I'll commit a change to the PowerPC backend to make this pattern *very* common, and so it is important that the RegisterCoalescer can eliminate it when that's profitable.

Thanks again!



-------------- next part --------------
A non-text attachment was scrubbed...
Name: D6978.18184.patch
Type: text/x-patch
Size: 3366 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20150114/d3eb51f3/attachment.bin>

More information about the llvm-commits mailing list