This is an archive of the discontinued LLVM Phabricator instance.

RegisterCoalescer: Gracefully continue if subrange merging fails.
ClosedPublic

Authored by MatzeB on Mar 3 2015, 3:24 PM.

Details

Reviewers
qcolombet
Summary

There is a known bug where the register coalescer fails to merge
subranges when multiple ranges end up in the "overflow" bit 32 of the
lanemasks. A proper fix for this is complicated so for now this is a
workaround which lets the register coalescer drop the subregister
liveness information (we just loose some precision by that) and
continue.

Diff Detail

Repository
rL LLVM

Event Timeline

MatzeB updated this revision to Diff 21151.Mar 3 2015, 3:24 PM
MatzeB retitled this revision from to RegisterCoalescer: Gracefully continue if subrange merging fails..
MatzeB updated this object.
MatzeB edited the test plan for this revision. (Show Details)
MatzeB added a reviewer: qcolombet.
MatzeB set the repository for this revision to rL LLVM.
MatzeB added a subscriber: tstellarAMD.
qcolombet edited edge metadata.Mar 3 2015, 3:52 PM

Hi Matthias,

The change looks good, just a few nitpicks.
Any chance we could get a testcase with that, or R600 does not expose it?

Thanks,
-Quentin

lib/CodeGen/RegisterCoalescer.cpp
163

Add a comment on what this function returns.

168

Ditto.

2398

Please update the comment before that condition to explain that we currently do not handle the overflow bit.
Update the debug output as well to print something along the same line instead of "This should not happen!”.

2539

Says that this is a limitation of the current implement instead of this shouldn’t happen, since it does happen :).

2544

Add a message in the assert, e.g., this situation should happen only for the overflow bit.

MatzeB added a comment.Mar 3 2015, 3:56 PM

+llvm-commits this time

Unfortunately this is only exposed if you have a subregister index which produces lanemasks with more than 31bits. None of the targets in trunk gets close to that.

  • Matthias
qcolombet accepted this revision.Mar 3 2015, 4:03 PM
qcolombet edited edge metadata.

Thanks Matthias for the update.

Please land the patch whenever you’ve made the changes for the nitpicks.

Cheers,
-Quentin

This revision is now accepted and ready to land.Mar 3 2015, 4:03 PM
MatzeB closed this revision.Mar 4 2015, 10:38 AM

Landed in r231186