This is an archive of the discontinued LLVM Phabricator instance.

[CodeGen] Split some functionality from DetectDeadLanes into its own class to be reused. NFCi
ClosedPublic

Authored by craig.topper on Jan 18 2023, 12:01 AM.

Details

Summary

This is an alternative to D140382.

This moves the first part of runOnce into a new class that can be
reused by D129735. This encapsulates the ownership of the worklist,
and VRegInfos into the new class. The code for updating the dead
lanes stays in the DetectDeadLanes class.

The new class is created on the stack during runOnMachineFunction
so all the data structures will be deleted after each run.
Previously we only cleared them after each run so the memory might
have stayed allocated across runs. Except for VRegInfo which was
always deleted. Hopefully this allocation change isn't a big deal.

I might still do some reordering of the functions to keep the classes
together, but I didn't do that yet to reduce the diff size.

Diff Detail

Event Timeline

craig.topper created this revision.Jan 18 2023, 12:01 AM
Herald added a project: Restricted Project. · View Herald TranscriptJan 18 2023, 12:01 AM
Herald added a subscriber: hiraditya. · View Herald Transcript
craig.topper requested review of this revision.Jan 18 2023, 12:01 AM
Herald added a project: Restricted Project. · View Herald TranscriptJan 18 2023, 12:01 AM
Herald added a subscriber: wdng. · View Herald Transcript
BeMg accepted this revision.Jan 22 2023, 5:41 AM

LGTM

This revision is now accepted and ready to land.Jan 22 2023, 5:41 AM
craig.topper edited the summary of this revision. (Show Details)Jan 23 2023, 4:24 PM

Reorder classes and methods to keep all of the code for the two classes grouped together.

Minor comment improvement

craig.topper retitled this revision from [CodeGen][WIP] Split some functionality from DetectDeadLanes into its own class to be reused. NFCi to [CodeGen] Split some functionality from DetectDeadLanes into its own class to be reused. NFCi.Jan 23 2023, 4:58 PM