Page MenuHomePhabricator

[NFC][regalloc] Unit test for AllocationOrder iteration.
ClosedPublic

Authored by mtrofin on Sep 28 2020, 4:44 PM.

Details

Summary

Added unittests. In the process, separated core construction - which just
needs the hits, order, and 'HardHints' values - from construction from
current register allocation state, to simplify testing.

Diff Detail

Event Timeline

mtrofin created this revision.Sep 28 2020, 4:44 PM
mtrofin requested review of this revision.Sep 28 2020, 4:44 PM

Hi @mtrofin,

Thanks for doing this.

LGTM with one comment.

Cheers,
-Quentin

llvm/lib/CodeGen/AllocationOrder.h
46

What's the rationale for turning this constructor into a static method?

llvm/unittests/CodeGen/AllocationOrderTest.cpp
115

Please add a new line.

mtrofin updated this revision to Diff 295039.Sep 29 2020, 10:33 AM
mtrofin marked 2 inline comments as done.

newline

llvm/lib/CodeGen/AllocationOrder.h
46

This allows the members of AllocationOrder to be const-ed (ArrayRef has read-only semantics, so that's the exception). This, imho, simplifies readability - one doesn't need to worry about mutation when glancing at this code.

This revision was not accepted when it landed; it landed in state Needs Review.Sep 29 2020, 10:48 AM
This revision was landed with ongoing or failed builds.
This revision was automatically updated to reflect the committed changes.