================ @@ -143,11 +170,43 @@ void XRayInstrumentation::prependRetWithPatchableExit( } } -bool XRayInstrumentation::runOnMachineFunction(MachineFunction &MF) { +PreservedAnalyses +XRayInstrumentationPass::run(MachineFunction &MF, + MachineFunctionAnalysisManager &MFAM) { + MachineDominatorTree *MDT = nullptr; + MachineLoopInfo *MLI = nullptr; + + if (XRayInstrumentation::needMDTAndMLIAnalyses(MF.getFunction())) { + MDT = MFAM.getCachedResult<MachineDominatorTreeAnalysis>(MF); + MLI = MFAM.getCachedResult<MachineLoopAnalysis>(MF); + } + + if (!XRayInstrumentation(MDT, MLI).run(MF)) + return PreservedAnalyses::all(); + + return getMachineFunctionPassPreservedAnalyses() + .preserve<MachineDominatorTreeAnalysis>() + .preserve<MachineLoopAnalysis>() + .preserveSet<CFGAnalyses>(); ---------------- paperchalice wrote:
I think `preserveSet<CFGAnalyses>()` is enough here. https://github.com/llvm/llvm-project/pull/129865 _______________________________________________ llvm-branch-commits mailing list llvm-branch-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-branch-commits