[PATCH] D38128: Handle COPYs of physregs better (regalloc hints)

Ulrich Weigand via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Oct 25 05:00:25 PDT 2017


uweigand added a comment.

Right.  **Always** coalescing with the copy source of course extends the live range of the source, and thus increases overall register pressure.  So it's not a good idea to do this unconditionally.

On the other hand, in the example that triggered this discussion, there was no register pressure problem and source and destination register just happened to be both still live at the point of use, anyway.  In this specific case, it would be preferable to use the source instead of the dest register at the point of use.  On the other hand, if keeping the source alive would cause extra spilling, we don't want that, but want to use the dest after all.

Not sure how exactly to handle this in LLVM.   It is probably not simply a matter of preference in the register coalescer.


https://reviews.llvm.org/D38128





More information about the llvm-commits mailing list