================
@@ -1229,8 +1248,15 @@ FunctionPass *llvm::createSPIRVStructurizerPass() {
 
 PreservedAnalyses SPIRVStructurizerWrapper::run(Function &F,
                                                 FunctionAnalysisManager &AF) {
-  FunctionPass *StructurizerPass = createSPIRVStructurizerPass();
-  if (!StructurizerPass->runOnFunction(F))
+  // TODO: Review this after migrating SPIRV passes to "modern" pass manager.
+  auto FPM = legacy::FunctionPassManager(F.getParent());
+  FPM.add(createLoopSimplifyPass());
+  FPM.add(new DominatorTreeWrapperPass());
+  FPM.add(new LoopInfoWrapperPass());
+  FPM.add(new SPIRVConvergenceRegionAnalysisWrapperPass());
+  FPM.add(createSPIRVStructurizerPass());
+
+  if (!FPM.run(F))
----------------
Keenuts wrote:
For the `LoopSimplify` pass itself, we could probably remove it, and expect the 
user respect the preconditions.

For the others, aren't all supporting both pass managers?

https://github.com/llvm/llvm-project/pull/116331
_______________________________________________
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to