This is an archive of the discontinued LLVM Phabricator instance.

[TargetRegisterInfo] Remove temporary hook enableMultipleCopyHints()
ClosedPublic

Authored by jonpa on Sep 20 2018, 10:19 AM.

Details

Summary

Finally, all targets are enabling multiple regalloc hints, so the hook to disable this can now be removed.

NFC.

Diff Detail

Event Timeline

jonpa created this revision.Sep 20 2018, 10:19 AM

Does this need a comment in the 8.00 release notes? What about RISVC/WASM since it looks like they're about to lose their experimental status?

This probably needs to wait until the compile time regressions have been addressed: https://lists.llvm.org/pipermail/llvm-commits/Week-of-Mon-20180924/590785.html

jonpa updated this revision to Diff 167616.Sep 29 2018, 11:09 AM

I think the recent discoveries of compile time regressions were due to multiple copy hints being added for the same register many times.

The CopyHint is inserted into a set, and I must have assumed that the hint weight would most likely be the same for the same physical register, and therefore there should only be one CopyHint per reg. This was not the case in the test case provided by Jonathan where a lot of hints were added, since this happens even with just a tiny difference in the float spill weight. This test case seemed to have thousands of small intervals for some phys regs, so in this case that meant a lot of hints for that register.

I updated the patch to make sure that the sorted set of CopyHints only has one hint per register. This is achieved by checking at insertion if the register already had a hint, and if so, remove that hint and insert the new one, if the new hint has a greater weight.

This luckily seems to be completely NFC, so all tests are still passing.

In fact, the temporary hack (which this patch removes) really should be removed since it is now clear that its ordering of the hints with the temporary CopyHintOrder++ method (for targets that do not enable), is also getting a lot of duplicated hints for the same register.

Possibly, I could first handle this issue with a patch without removing the target hook if there is any reason to do so. It seems however this is "general goodness" as Quentin pointed out earlier, so there shouldn't be any target desiring to not enable, right (in-trunk or not)?

This probably needs to wait until the compile time regressions have been addressed: https://lists.llvm.org/pipermail/llvm-commits/Week-of-Mon-20180924/590785.html

I patched this in, and I'm no longer seeing compile time regressions at head.

@jonpa Please can you split this patch into 2 stages (the regression fix and the removal of enableMultipleCopyHints()).

jonpa added a comment.Oct 3 2018, 3:03 AM

@jonpa Please can you split this patch into 2 stages (the regression fix and the removal of enableMultipleCopyHints()).

First part for the regression fix is now here: https://reviews.llvm.org/D52826

The actual handling is somewhat different now and should this time be correct.

jonpa updated this revision to Diff 168232.Oct 3 2018, 11:50 PM

Updated patch to again just remove the enableMultipleCopyHints() hook.

nhaehnle removed a subscriber: nhaehnle.Oct 5 2018, 6:19 AM
RKSimon accepted this revision.Oct 5 2018, 7:07 AM

LGTM - thanks

This revision is now accepted and ready to land.Oct 5 2018, 7:07 AM
jonpa closed this revision.Oct 5 2018, 7:27 AM

Thanks for review!
r343851.