[llvm-branch-commits] [llvm] [CodeGen][NewPM] Port RegUsageInfoCollector pass to NPM (PR #113874)

Akshat Oke via llvm-branch-commits llvm-branch-commits at lists.llvm.org
Mon Nov 4 02:20:20 PST 2024


================
@@ -97,14 +104,32 @@ static bool isCallableFunction(const MachineFunction &MF) {
   }
 }
 
-bool RegUsageInfoCollector::runOnMachineFunction(MachineFunction &MF) {
+PreservedAnalyses
+RegUsageInfoCollectorPass::run(MachineFunction &MF,
+                               MachineFunctionAnalysisManager &MFAM) {
+  Module &MFA = *MF.getFunction().getParent();
+  auto *PRUI = MFAM.getResult<ModuleAnalysisManagerMachineFunctionProxy>(MF)
+                   .getCachedResult<PhysicalRegisterUsageAnalysis>(MFA);
+  assert(PRUI && "PhysicalRegisterUsageAnalysis not available");
----------------
optimisan wrote:

The machine function's OuterAnalysisProxy can't run the module analysis (as we are inside a module)

https://github.com/llvm/llvm-project/pull/113874


More information about the llvm-branch-commits mailing list