================
@@ -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
_______________________________________________
llvm-branch-commits mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-branch-commits

Reply via email to