[PATCH] D141590: [PassManager] Add some passes to the sequence of extra vector passes

Tiehu Zhang via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Jan 12 03:16:42 PST 2023


TiehuZhang created this revision.
TiehuZhang added reviewers: fhahn, sdesmalen, dmgreen, mdchen.
Herald added subscribers: StephenFan, hiraditya.
Herald added a project: All.
TiehuZhang requested review of this revision.
Herald added a project: LLVM.
Herald added a subscriber: llvm-commits.

When 'extra-vectorizer-passes' is enabled, many additional vector passes will be run, resulting in better IR. This patch adding LoopIdiomRecognizePass and IndVarSimplifyPass to the sequence after SimpleLoopUnswitchPass, which are useful for generating better IR. LoopIdiomRecognizePass can transform simple loops into a non-loop form, and IndVarSimplifyPass can transform induction variables into simpler forms (If possiable).


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D141590

Files:
  llvm/lib/Passes/PassBuilderPipelines.cpp


Index: llvm/lib/Passes/PassBuilderPipelines.cpp
===================================================================
--- llvm/lib/Passes/PassBuilderPipelines.cpp
+++ llvm/lib/Passes/PassBuilderPipelines.cpp
@@ -1135,6 +1135,8 @@
                          /*AllowSpeculation=*/true));
     LPM.addPass(SimpleLoopUnswitchPass(/* NonTrivial */ Level ==
                                        OptimizationLevel::O3));
+    LPM.addPass(LoopIdiomRecognizePass());
+    LPM.addPass(IndVarSimplifyPass());
     ExtraPasses.addPass(
         RequireAnalysisPass<OptimizationRemarkEmitterAnalysis, Function>());
     ExtraPasses.addPass(


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D141590.488577.patch
Type: text/x-patch
Size: 628 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20230112/f8580345/attachment.bin>


More information about the llvm-commits mailing list