[llvm-branch-commits] [WebAssembly] Port WebAssemblyCFGSortPass (PR #210247)
Heejin Ahn via llvm-branch-commits
llvm-branch-commits at lists.llvm.org
Sat Jul 18 00:06:11 PDT 2026
================
@@ -395,3 +396,24 @@ bool WebAssemblyCFGSort::runOnMachineFunction(MachineFunction &MF) {
return true;
}
+
+bool WebAssemblyCFGSortLegacy::runOnMachineFunction(MachineFunction &MF) {
+ MachineLoopInfo &MLI = getAnalysis<MachineLoopInfoWrapperPass>().getLI();
+ WebAssemblyExceptionInfo &WEI =
+ getAnalysis<WebAssemblyExceptionInfoWrapperPass>().getWEI();
+ MachineDominatorTree &MDT =
+ getAnalysis<MachineDominatorTreeWrapperPass>().getDomTree();
+ return sortCFG(MF, MLI, WEI, MDT);
+}
+
+PreservedAnalyses
+WebAssemblyCFGSortPass::run(MachineFunction &MF,
+ MachineFunctionAnalysisManager &MFAM) {
+ MachineLoopInfo &MLI = MFAM.getResult<MachineLoopAnalysis>(MF);
+ WebAssemblyExceptionInfo &WEI =
+ MFAM.getResult<WebAssemblyExceptionAnalysis>(MF);
+ MachineDominatorTree &MDT = MFAM.getResult<MachineDominatorTreeAnalysis>(MF);
+ return sortCFG(MF, MLI, WEI, MDT) ? getMachineFunctionPassPreservedAnalyses()
+ .preserveSet<CFGAnalyses>()
+ : PreservedAnalyses::all();
----------------
aheejin wrote:
https://github.com/llvm/llvm-project/blob/6a33b69d8bae737e5e1d60c7b7776a0b1f885bfa/llvm/lib/Target/WebAssembly/WebAssemblyCFGSort.cpp#L50-L59
So like `MachineDominatorTree`, is `MachineLoopInfo` preservation also handled with CFG? What about `WebAssemblyExceptionInfo`?
https://github.com/llvm/llvm-project/pull/210247
More information about the llvm-branch-commits
mailing list