[llvm] [WebAssembly] Port WebAssemblySetP2AlignOperandsPass (PR #209871)

Heejin Ahn via llvm-commits llvm-commits at lists.llvm.org
Fri Jul 17 23:48:52 PDT 2026


================
@@ -94,3 +97,16 @@ bool WebAssemblySetP2AlignOperands::runOnMachineFunction(MachineFunction &MF) {
 
   return Changed;
 }
+
+bool WebAssemblySetP2AlignOperandsLegacy::runOnMachineFunction(
+    MachineFunction &MF) {
+  return setP2AlignOperands(MF);
+}
+
+PreservedAnalyses
+WebAssemblySetP2AlignOperandsPass::run(MachineFunction &MF,
+                                       MachineFunctionAnalysisManager &MFAM) {
+  return setP2AlignOperands(MF) ? getMachineFunctionPassPreservedAnalyses()
+                                      .preserveSet<CFGAnalyses>()
+                                : PreservedAnalyses::all();
----------------
aheejin wrote:

Sorry for the late comment. We seem to preserve `MachineDominator` and `MachineBlockFrequencyInfo` too
https://github.com/llvm/llvm-project/blob/6a33b69d8bae737e5e1d60c7b7776a0b1f885bfa/llvm/lib/Target/WebAssembly/WebAssemblySetP2AlignOperands.cpp#L39-L44

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


More information about the llvm-commits mailing list