[llvm-branch-commits] [RISCV] Port PostLegalizerCombiner to NewPM (PR #235951)
Craig Topper via llvm-branch-commits
llvm-branch-commits at lists.llvm.org
Thu Oct 29 21:14:30 PDT 2026
================
@@ -163,31 +166,32 @@ void RISCVPostLegalizerCombiner::getAnalysisUsage(AnalysisUsage &AU) const {
MachineFunctionPass::getAnalysisUsage(AU);
}
-RISCVPostLegalizerCombiner::RISCVPostLegalizerCombiner()
- : MachineFunctionPass(ID) {
- if (!RuleConfig.parseCommandLineOption())
- report_fatal_error("Invalid rule identifier");
-}
+RISCVPostLegalizerCombinerLegacy::RISCVPostLegalizerCombinerLegacy()
+ : MachineFunctionPass(ID) {}
-bool RISCVPostLegalizerCombiner::runOnMachineFunction(MachineFunction &MF) {
+static bool
+runCombinerOnMachineFunction(MachineFunction &MF,
+ function_ref<bool()> ShouldSkip,
+ function_ref<GISelValueTracking *()> GetVT,
+ function_ref<MachineDominatorTree *()> GetMDT,
+ function_ref<GISelCSEInfo *()> GetCSEInfo) {
if (MF.getProperties().hasFailedISel())
return false;
assert(MF.getProperties().hasLegalized() && "Expected a legalized function?");
- auto *TPC = &getAnalysis<TargetPassConfig>();
const Function &F = MF.getFunction();
bool EnableOpt =
- MF.getTarget().getOptLevel() != CodeGenOptLevel::None && !skipFunction(F);
+ MF.getTarget().getOptLevel() != CodeGenOptLevel::None && !ShouldSkip();
+
+ RISCVPostLegalizerCombinerImplRuleConfig RuleConfig;
----------------
topperc wrote:
How expensive is this object to construct?
https://github.com/llvm/llvm-project/pull/235951
More information about the llvm-branch-commits
mailing list