[llvm-branch-commits] [RISCV] Port PreLegalizerCombiner to NewPM (PR #235967)

Craig Topper via llvm-branch-commits llvm-branch-commits at lists.llvm.org
Thu Oct 29 21:17:20 PDT 2026


================
@@ -113,32 +116,30 @@ void RISCVPreLegalizerCombiner::getAnalysisUsage(AnalysisUsage &AU) const {
   MachineFunctionPass::getAnalysisUsage(AU);
 }
 
-RISCVPreLegalizerCombiner::RISCVPreLegalizerCombiner()
-    : MachineFunctionPass(ID) {
-  if (!RuleConfig.parseCommandLineOption())
-    report_fatal_error("Invalid rule identifier");
-}
+RISCVPreLegalizerCombinerLegacy::RISCVPreLegalizerCombinerLegacy()
+    : MachineFunctionPass(ID) {}
 
-bool RISCVPreLegalizerCombiner::runOnMachineFunction(MachineFunction &MF) {
+static bool
+runVPreLegalizerCombiner(MachineFunction &MF, function_ref<bool()> ShouldSkip,
+                         function_ref<GISelCSEInfo *()> GetCSEInfo,
+                         function_ref<GISelValueTracking *()> GetVT,
+                         function_ref<MachineDominatorTree *()> GetMDT) {
   if (MF.getProperties().hasFailedISel())
     return false;
-  auto &TPC = getAnalysis<TargetPassConfig>();
+  RISCVPreLegalizerCombinerImplRuleConfig RuleConfig;
----------------
topperc wrote:

How expensive is this to build since its been moved from the pass constructor to every invocation.

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


More information about the llvm-branch-commits mailing list