This is an archive of the discontinued LLVM Phabricator instance.

[Spill2Reg][6/9] Added live register tracking.
Needs ReviewPublic

Authored by vporpo on Jan 26 2022, 5:56 PM.
This revision needs review, but there are no reviewers specified.

Details

Reviewers
None
Summary

This patch implements tracking of live registers. This is used to look for free
vector registers. It works by walking up the CFG from the reloads all the way
to the spills, accumulating the register units being used.
This implementation caches the live register units used by each MBB for faster
compilation time.

Note: Live register tracking relies on MBB liveins/outs being maintained
correctly, which is implemented in a follow-up patch. So this patch will still
not generate correct code for all but some simple cases.

Diff Detail

Event Timeline

vporpo created this revision.Jan 26 2022, 5:56 PM
vporpo requested review of this revision.Jan 26 2022, 5:56 PM
Herald added a project: Restricted Project. · View Herald TranscriptJan 26 2022, 5:56 PM
wxiao3 added a subscriber: wxiao3.Jan 26 2022, 7:19 PM
vporpo updated this revision to Diff 405812.Feb 3 2022, 3:09 PM

Updated tests.

arsenm added a subscriber: arsenm.Feb 3 2022, 3:21 PM
arsenm added inline comments.
llvm/lib/CodeGen/Spill2Reg.cpp
243–247

Why can't you use df_iterator?

310

Typo Wlaks

340

No else after return

vporpo retitled this revision from [Spill2Reg] Added live register tracking. to [Spill2Reg][6/9] Added live register tracking..Feb 4 2022, 9:50 AM
Herald added a project: Restricted Project. · View Herald TranscriptAug 2 2022, 12:05 PM