[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>