[llvm] [CodeGen][NewPM] Port `ReachingDefAnalysis` to new pass manager. (PR #159572)

Mikhail Gudim via llvm-commits llvm-commits at lists.llvm.org
Thu Sep 18 09:15:44 PDT 2025


================
@@ -20,13 +20,55 @@ using namespace llvm;
 
 #define DEBUG_TYPE "reaching-defs-analysis"
 
-static cl::opt<bool> PrintAllReachingDefs("print-all-reaching-defs", cl::Hidden,
-                                          cl::desc("Used for test purpuses"),
-                                          cl::Hidden);
+AnalysisKey ReachingDefAnalysis::Key;
 
-char ReachingDefAnalysis::ID = 0;
-INITIALIZE_PASS(ReachingDefAnalysis, DEBUG_TYPE, "ReachingDefAnalysis", false,
-                true)
+ReachingDefAnalysis::Result
+ReachingDefAnalysis::run(MachineFunction &MF,
+                         MachineFunctionAnalysisManager &MFAM) {
+  ReachingDefInfo RDI;
----------------
mgudim wrote:

Not sure how MFPropsModifier works, I just copied from other pass) I haven't seen example of this used with analysis pass.

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


More information about the llvm-commits mailing list