This is an archive of the discontinued LLVM Phabricator instance.

RegAllocGreedy: Allow last chance recolor to retry overlapping tuples
ClosedPublic

Authored by arsenm on Apr 6 2022, 5:23 PM.

Details

Summary

Last chance recoloring didn't try recoloring a done register with the
same class since it believed there was no point. This doesn't
necessarily apply if the members in that class overlap. Allow the
recoloring to proceed if the assigned interfering physical register
overlaps with the candidate register.

This avoids an allocation failure with overlapping tuples. This
testcase could be handled better, and I don't believe should reach
last chance recoloring. The failure only manifests with the mutually
unsatisfiable register hints to overlapping tuples. The earlier
assignment decisions probably should have figured out that using these
hints was a bad idea.

Diff Detail

Event Timeline

arsenm created this revision.Apr 6 2022, 5:23 PM
Herald added a project: Restricted Project. · View Herald TranscriptApr 6 2022, 5:23 PM
arsenm requested review of this revision.Apr 6 2022, 5:23 PM
Herald added a project: Restricted Project. · View Herald TranscriptApr 6 2022, 5:23 PM
Herald added a subscriber: wdng. · View Herald Transcript
qcolombet accepted this revision.Apr 7 2022, 9:24 AM
This revision is now accepted and ready to land.Apr 7 2022, 9:24 AM

This makes sense to me.

I ran fuzz tests over night on my out-of-tree target with the change without any problems.
Thanks!