This is an archive of the discontinued LLVM Phabricator instance.

[nfc][regalloc] const LiveIntervals within the allocator
ClosedPublic

Authored by mtrofin on Feb 3 2022, 9:09 AM.

Details

Summary

Once built, LiveIntervals are immutable. This patch captures that.

Diff Detail

Event Timeline

mtrofin created this revision.Feb 3 2022, 9:09 AM
mtrofin requested review of this revision.Feb 3 2022, 9:09 AM
Herald added a project: Restricted Project. · View Herald TranscriptFeb 3 2022, 9:09 AM

sorry it's long (and mostly boring). The only more involved change is in SplitKit, see getSubRangeForMaskExact, which is also used when building up LIs. Also made it and getSubRangeForMask static, they weren't member functions.

The rest is const sprinkling.

MatzeB accepted this revision.Feb 3 2022, 9:54 AM

It's a lot of code churn. But I agree that it's a good thing to be explicit and add a const here. Thanks, LGTM.

llvm/lib/CodeGen/SplitKit.h
349–366

May just as well make them simple static helper functions in SplitKit.cpp no other files appear to use them.

This revision is now accepted and ready to land.Feb 3 2022, 9:54 AM
mtrofin updated this revision to Diff 405748.Feb 3 2022, 12:35 PM
mtrofin marked an inline comment as done.

feedback

This revision was landed with ongoing or failed builds.Feb 3 2022, 12:35 PM
This revision was automatically updated to reflect the committed changes.