[PATCH] D49097: [RegisterCoalescer] Another fix for subrange join unreachable

Tim Renouf via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Sat Aug 25 09:00:26 PDT 2018


tpr added a comment.

This fix adds code to scan all uses of a subrange and extend it, after every join. I can't think of a way of doing it in a lower impact way.

Which has got me thinking:

Am I right about all of the following?

1. The decision on whether to join a copy is taken only with reference to each register's main range, not the subrange.
2. The only reason it does similar stuff with conflict detection and resolution on the subranges is so it can modify them incrementally.
3. This fix, scanning all uses and extending subranges after a join, pretty much nullifies the advantage of modifying subranges incrementally.

If so, why not remove all the code that incrementally modifies subranges, and instead remove the subranges of any register affected by a join, and recalculate them from scratch at the end of the whole pass? That would simplify the code, and we have found quite a few bugs in the way that subranges are incrementally modified.


Repository:
  rL LLVM

https://reviews.llvm.org/D49097





More information about the llvm-commits mailing list