Page MenuHomePhabricator

RegAllocFast: Improve hinting heuristic
Needs ReviewPublic

Authored by arsenm on Nov 9 2018, 4:35 PM.


  • Trace through multiple COPYs when looking for a physreg source.
  • Add hinting for vregs that will be copied into physregs (we only hinted for vregs getting copied to a physreg previously).
  • Give hinted a register a bonus when deciding which value to spill.

This is part of my rewrite regallocfast series. In fact this one doesn't even have an effect unless you also flip the allocation to happen from back to front of a basic block. Nonetheless it helps to split this up to ease review of D52010

Diff Detail

Event Timeline

MatzeB created this revision.Nov 9 2018, 4:35 PM
arsenm added inline comments.Nov 9 2018, 5:03 PM

Isn't this the same as MI.isFullCopy()?

I do see test changes with this (at least with D54366 reverted). At least one of them is a regression for this situation:

%11:sreg_32_xm0 = COPY %0.sub1
%12:sreg_32_xm0 = COPY %0.sub0

This inserts 2 64-bit restores of %0, and each one uses only one of the subregisters. Previously this did the right thing, and only restored once

Herald added a project: Restricted Project. · View Herald TranscriptMar 17 2019, 10:55 AM
arsenm commandeered this revision.Mar 19 2019, 10:34 AM
arsenm updated this revision to Diff 191349.
arsenm edited reviewers, added: MatzeB; removed: arsenm.

Use isFullCopy, add test changes