This is an archive of the discontinued LLVM Phabricator instance.

RegAllocGreedy: Allow target to specify register class ordering.
ClosedPublic

Authored by MatzeB on Mar 25 2015, 8:13 PM.

Details

Summary

Specify an allocation order with a register class. This is used by register
allocators with a greedy heuristic. This is usefull as it is sometimes
beneficial to color more constrained classes first.

Diff Detail

Repository
rL LLVM

Event Timeline

MatzeB updated this revision to Diff 22697.Mar 25 2015, 8:13 PM
MatzeB retitled this revision from to RegAllocGreedy: Allow target to specify register class ordering..
MatzeB updated this object.
MatzeB edited the test plan for this revision. (Show Details)
MatzeB added reviewers: qcolombet, atrick.
MatzeB set the repository for this revision to rL LLVM.
MatzeB added a subscriber: Unknown Object (MLST).
atrick edited edge metadata.Mar 25 2015, 9:25 PM

Ok. The comment is misleading though. It makes it sounds as though getClassPriority can be used to prioritize "big" live ranges. I think it instead allows register class order to take precedence over live range size.

Also, this really puts the burden on the target to assign priorities that make sense in the context of the regalloc algorithm. I think it's ok to have that back door, but it seems like there should be a use-at-your-own risk disclaimer, no? I would indicate that the default implementation should be used unless the hook is really needed to improve allocation.

qcolombet edited edge metadata.Mar 26 2015, 9:58 AM

Agreed with Andy.

Also, I believe it would make sense to have that tablegen driven (like the allocation order), we possibly a hook to override.

Q.

MatzeB updated this revision to Diff 22993.Mar 31 2015, 11:56 AM
MatzeB updated this object.
MatzeB edited edge metadata.
MatzeB removed rL LLVM as the repository for this revision.

New version which sets priority with tablegen.

atrick accepted this revision.Mar 31 2015, 12:34 PM
atrick edited edge metadata.

LGTM.

This revision is now accepted and ready to land.Mar 31 2015, 12:34 PM
This revision was automatically updated to reflect the committed changes.