[CodeGen] Split some functionality from DetectDeadLanes into its own class to be...
authorCraig Topper <craig.topper@sifive.com>
Wed, 25 Jan 2023 21:09:58 +0000 (13:09 -0800)
committerCraig Topper <craig.topper@sifive.com>
Wed, 25 Jan 2023 21:27:46 +0000 (13:27 -0800)
commit23d576bb838efa54cba6217728e6443264bf0f5d
tree8fa40dfd3f3fff041de35236b70ab3433b825da5
parent7768f63e5b7adc8a92b8f8041e9c1d298b011128
[CodeGen] Split some functionality from DetectDeadLanes into its own class to be reused. NFC

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.

Reviewed By: BeMg

Differential Revision: https://reviews.llvm.org/D141993
llvm/include/llvm/CodeGen/DetectDeadLanes.h [new file with mode: 0644]
llvm/lib/CodeGen/DetectDeadLanes.cpp