[llvm] [VPlan] Extract reverse operation for reverse accesses (PR #146525)
via llvm-commits
llvm-commits at lists.llvm.org
Thu Aug 14 08:00:14 PDT 2025
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 HEAD~1 HEAD --extensions cpp,h -- llvm/lib/Transforms/Vectorize/LoopVectorize.cpp llvm/lib/Transforms/Vectorize/VPRecipeBuilder.h llvm/lib/Transforms/Vectorize/VPlan.h llvm/lib/Transforms/Vectorize/VPlanAnalysis.cpp llvm/lib/Transforms/Vectorize/VPlanRecipes.cpp llvm/lib/Transforms/Vectorize/VPlanTransforms.cpp llvm/unittests/Transforms/Vectorize/VPlanTest.cpp
``````````
</details>
<details>
<summary>
View the diff from clang-format here.
</summary>
``````````diff
diff --git a/llvm/lib/Transforms/Vectorize/LoopVectorize.cpp b/llvm/lib/Transforms/Vectorize/LoopVectorize.cpp
index 6cd5bed55..88212d2a5 100644
--- a/llvm/lib/Transforms/Vectorize/LoopVectorize.cpp
+++ b/llvm/lib/Transforms/Vectorize/LoopVectorize.cpp
@@ -7757,8 +7757,7 @@ VPRecipeBase *VPRecipeBuilder::tryToWidenMemory(Instruction *I,
}
if (Reverse && Mask)
- Mask =
- Builder.createNaryOp(VPInstruction::Reverse, Mask, I->getDebugLoc());
+ Mask = Builder.createNaryOp(VPInstruction::Reverse, Mask, I->getDebugLoc());
if (auto *Load = dyn_cast<LoadInst>(I)) {
auto *LoadR =
diff --git a/llvm/lib/Transforms/Vectorize/VPlanRecipes.cpp b/llvm/lib/Transforms/Vectorize/VPlanRecipes.cpp
index 02abadf6f..39b1cc1c7 100644
--- a/llvm/lib/Transforms/Vectorize/VPlanRecipes.cpp
+++ b/llvm/lib/Transforms/Vectorize/VPlanRecipes.cpp
@@ -2177,7 +2177,7 @@ InstructionCost VPWidenCastRecipe::computeCost(ElementCount VF,
if (VPRecipeBase *Recipe = GetOnlyUser(this)) {
if (match(Recipe, m_VPInstruction<VPInstruction::Reverse>(m_VPValue()))) {
Recipe = GetOnlyUser(cast<VPInstruction>(Recipe));
- IsReverse = true;
+ IsReverse = true;
}
if (Recipe)
CCH = ComputeCCH(Recipe);
``````````
</details>
https://github.com/llvm/llvm-project/pull/146525
More information about the llvm-commits
mailing list