[llvm-branch-commits] [llvm] [RISCV] Port Vector Peephole to NewPM (PR #215671)

Aiden Grossman via llvm-branch-commits llvm-branch-commits at lists.llvm.org
Tue Aug 11 20:04:29 PDT 2026


================
@@ -823,6 +827,24 @@ bool RISCVVectorPeephole::runOnMachineFunction(MachineFunction &MF) {
   return Changed;
 }
 
+bool RISCVVectorPeepholeLegacy::runOnMachineFunction(MachineFunction &MF) {
+  if (skipFunction(MF.getFunction()))
+    return false;
+  return RISCVVectorPeepholeImpl().run(MF);
+}
+
+PreservedAnalyses
+RISCVVectorPeepholePass::run(MachineFunction &MF,
+                             MachineFunctionAnalysisManager &MFAM) {
+  bool Changed = RISCVVectorPeepholeImpl().run(MF);
+  if (!Changed)
+    return PreservedAnalyses::all();
+
+  PreservedAnalyses PA = getMachineFunctionPassPreservedAnalyses();
+  PA.preserveSet<CFGAnalyses>();
----------------
boomanaiden154 wrote:

We preserve MachineRegisterClassInfoWrapperPass in the LegacyPM. Do we need to do that here?

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


More information about the llvm-branch-commits mailing list