Files
llvm-project/llvm/lib/CodeGen/MachineModuleSlotTracker.cpp
Teja Alaghari 759091b470 [CodeGen][NPM] Avoid MachineModuleInfo in MachineModuleSlotTracker (#171257)
This work is a continuation of
[PR#140530](https://github.com/llvm/llvm-project/pull/140530),
co-authored by @optimisan.

The PR refactors `MachineModuleSlotTracker` to support both the Legacy
Pass Manager and New Pass Manager by removing its direct dependency on
`MachineModuleInfo`.

`MachineModuleSlotTracker` requires `MachineModuleInfo` to obtain
`MachineFunction` instances when printing MIR. But
`MachineFunctionAnalysis` provides `MachineFunction` for NPM.

This patch refactors `MachineModuleSlotTracker` to use a function
callback (`MFGetterFnT`) instead of directly depending on
`MachineModuleInfo`.

---------

Co-authored-by: vikhegde <vikram.hegde@amd.com>
2025-12-19 18:49:42 +01:00

3.0 KiB