================
@@ -121,3 +124,21 @@ bool 
WebAssemblyOptimizeLiveIntervals::runOnMachineFunction(
 
   return true;
 }
+
+bool WebAssemblyOptimizeLiveIntervalsLegacy::runOnMachineFunction(
+    MachineFunction &MF) {
+  return optimizeLiveIntervals(
+      MF, getAnalysis<LiveIntervalsWrapperPass>().getLIS());
+}
+
+PreservedAnalyses WebAssemblyOptimizeLiveIntervalsPass::run(
+    MachineFunction &MF, MachineFunctionAnalysisManager &MFAM) {
+  bool Changed =
+      optimizeLiveIntervals(MF, MFAM.getResult<LiveIntervalsAnalysis>(MF));
+  if (!Changed)
+    return PreservedAnalyses::all();
+  return getMachineFunctionPassPreservedAnalyses()
+      .preserveSet<CFGAnalyses>()
+      .preserve<LiveIntervalsAnalysis>()
+      .preserve<SlotIndexesAnalysis>();
----------------
boomanaiden154 wrote:

`MachineBlockFrequencyInfo` and `MachineDominatorTree` are both preserved by 
marking the CFG as preserved.

I don't really understand why `LiveVariables` is preserved in the Legacy 
version. We don't do anything to maintain it, and it also isn't 
computed/invalidated anywhere around this pass in the pipeline, so I've left it 
omitted.

https://gist.github.com/boomanaiden154/7155128f498a4275079a6c6d870b60ef is the 
`-debug-pass-manager` output which shows that preserving 
`LiveVariablesAnalysis` shouldn't matter.

https://github.com/llvm/llvm-project/pull/209958
_______________________________________________
llvm-branch-commits mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-branch-commits

Reply via email to