[llvm] Swap UnrollAndJam Pass to before the SLP Vectorizer Pass (PR #97029)
via llvm-commits
llvm-commits at lists.llvm.org
Fri Jul 26 05:58:02 PDT 2024
github-actions[bot] wrote:
<!--LLVM CODE FORMAT COMMENT: {clang-format}-->
:warning: C/C++ code formatter, clang-format found issues in your code. :warning:
<details>
<summary>
You can test this locally with the following command:
</summary>
``````````bash
git-clang-format --diff bfa0cae31c1db7627c41dcebd660f5eaea796778 5088bacf52f667ed327018e958a01da9bf546d70 --extensions cpp -- llvm/lib/Passes/PassBuilderPipelines.cpp
``````````
</details>
<details>
<summary>
View the diff from clang-format here.
</summary>
``````````diff
diff --git a/llvm/lib/Passes/PassBuilderPipelines.cpp b/llvm/lib/Passes/PassBuilderPipelines.cpp
index 77743f275b..a8f9a1590c 100644
--- a/llvm/lib/Passes/PassBuilderPipelines.cpp
+++ b/llvm/lib/Passes/PassBuilderPipelines.cpp
@@ -1238,14 +1238,17 @@ void PassBuilder::addVectorPasses(OptimizationLevel Level,
FPM.addPass(InferAlignmentPass());
// We do UnrollAndJam in a separate LPM to Unroll to ensure it happens first.
- // In order for outer loop vectorization to be done, UnrollAndJam must occur before the SLPVectorizerPass.
- // Placing UnrollAndJam immediately after the LoopVectorizePass when !IsFullLTO leads to improved compile times versus
- // placing it immediately before the SLPVectorizerPass, due to analysis re-use.
+ // In order for outer loop vectorization to be done, UnrollAndJam must occur
+ // before the SLPVectorizerPass. Placing UnrollAndJam immediately after the
+ // LoopVectorizePass when !IsFullLTO leads to improved compile times versus
+ // placing it immediately before the SLPVectorizerPass, due to analysis
+ // re-use.
if (EnableUnrollAndJam && PTO.LoopUnrolling) {
// Cleanup after loop vectorization. Simplification passes like CVP and
// GVN, loop transforms, and others have already run, so it's now better to
// convert to more optimized IR using more aggressive simplify CFG options.
- // SimplifyCFGPass must be run before UnrollAndJam for UnrollAndJam-SLP outer loop vectorization to happen.
+ // SimplifyCFGPass must be run before UnrollAndJam for UnrollAndJam-SLP
+ // outer loop vectorization to happen.
FPM.addPass(SimplifyCFGPass(SimplifyCFGOptions()
.forwardSwitchCondToPhi(true)
.convertSwitchRangeToICmp(true)
``````````
</details>
https://github.com/llvm/llvm-project/pull/97029
More information about the llvm-commits
mailing list