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

via llvm-commits llvm-commits at lists.llvm.org
Thu Sep 18 06:50:20 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;
----------------
paperchalice wrote:

Use [MFPropsModifier](https://llvm.org/doxygen/classllvm_1_1MFPropsModifier.html#a0abbf442390713b95f5913ebe5987586) to handle properties, you can add getRequiredProperties method for this pass.

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


More information about the llvm-commits mailing list