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 origin/main HEAD --extensions cpp,h -- 
llvm/lib/Transforms/Vectorize/LoopVectorizationPlanner.h 
llvm/lib/Transforms/Vectorize/LoopVectorize.cpp 
llvm/lib/Transforms/Vectorize/VPlan.cpp llvm/lib/Transforms/Vectorize/VPlan.h 
--diff_from_common_commit
``````````

:warning:
The reproduction instructions above might return results for more than one PR
in a stack if you are using a stacked PR workflow. You can limit the results by
changing `origin/main` to the base branch/commit you want to compare against.
:warning:

</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 fbb19849e..c10d9af1b 100644
--- a/llvm/lib/Transforms/Vectorize/LoopVectorize.cpp
+++ b/llvm/lib/Transforms/Vectorize/LoopVectorize.cpp
@@ -3493,7 +3493,8 @@ std::unique_ptr<VPlan> 
LoopVectorizationPlanner::selectBestEpiloguePlan(
     LLVM_DEBUG(dbgs() << "LEV: Epilogue vectorization factor is forced.\n");
     ElementCount ForcedEC = 
ElementCount::getFixed(EpilogueVectorizationForceVF);
     if (hasPlanWithVF(ForcedEC, CM.foldTailByMasking())) {
-      std::unique_ptr<VPlan> Clone(getPlanFor(ForcedEC, 
CM.foldTailByMasking()).duplicate());
+      std::unique_ptr<VPlan> Clone(
+          getPlanFor(ForcedEC, CM.foldTailByMasking()).duplicate());
       Clone->setVF(ForcedEC);
       return Clone;
     }
@@ -5837,13 +5838,15 @@ std::pair<VectorizationFactor, VPlan *> 
LoopVectorizationPlanner::computeBestVF(
   if (VPlans.size() == 1) {
     // For outer loops, the plan has a single vector VF determined by the
     // heuristic.
-    assert((FirstPlan.hasScalarVFOnly() || hasPlanWithVF(UserVF, 
CM.foldTailByMasking()) ||
+    assert((FirstPlan.hasScalarVFOnly() ||
+            hasPlanWithVF(UserVF, CM.foldTailByMasking()) ||
             FirstPlan.isOuterLoop()) &&
            "must have a single scalar VF, UserVF or an outer loop");
     return {VectorizationFactor(FirstPlan.getSingleVF(), 0, 0), &FirstPlan};
   }
 
-  if (hasPlanWithVF(UserVF, CM.foldTailByMasking()) && 
EpilogueVectorizationForceVF > 1) {
+  if (hasPlanWithVF(UserVF, CM.foldTailByMasking()) &&
+      EpilogueVectorizationForceVF > 1) {
     assert(VPlans.size() == 2 && "Must have exactly 2 VPlans built");
     assert(VPlans[0]->getSingleVF() ==
                ElementCount::getFixed(EpilogueVectorizationForceVF) &&
@@ -8224,7 +8227,8 @@ bool LoopVectorizePass::processLoop(Loop *L) {
                   "Ignoring user-specified interleave count due to possibly "
                   "unsafe dependencies in the loop."};
     InterleaveLoop = false;
-  } else if (!LVP.hasPlanWithVF(VF.Width, CM.foldTailByMasking()) && UserIC > 
1) {
+  } else if (!LVP.hasPlanWithVF(VF.Width, CM.foldTailByMasking()) &&
+             UserIC > 1) {
     // Tell the user interleaving was avoided up-front, despite being 
explicitly
     // requested.
     LLVM_DEBUG(dbgs() << "LV: Ignoring UserIC, because vectorization and "
diff --git a/llvm/lib/Transforms/Vectorize/VPlan.cpp 
b/llvm/lib/Transforms/Vectorize/VPlan.cpp
index c1d168d51..b5a776d00 100644
--- a/llvm/lib/Transforms/Vectorize/VPlan.cpp
+++ b/llvm/lib/Transforms/Vectorize/VPlan.cpp
@@ -1317,8 +1317,10 @@ bool VPlan::isCompatibleWithTF(bool TF) {
   // compile-time, so conservatively keep TCNotDivisibleByVF = true.
   bool TCNotDivisibleByVF = true;
   if (auto *ConstTC = dyn_cast<VPConstantInt>(getTripCount())) {
-    const APInt &TC = 
cast<ConstantInt>(ConstTC->getLiveInIRValue())->getValue();
-    if (none_of(vectorFactors(), [](ElementCount VF) { return VF.isScalable(); 
}))
+    const APInt &TC =
+        cast<ConstantInt>(ConstTC->getLiveInIRValue())->getValue();
+    if (none_of(vectorFactors(),
+                [](ElementCount VF) { return VF.isScalable(); }))
       TCNotDivisibleByVF = any_of(vectorFactors(), [&TC](ElementCount VF) {
         APInt VFVal(TC.getBitWidth(), VF.getFixedValue());
         return TC.urem(VFVal) != 0;
@@ -1677,8 +1679,9 @@ bool LoopVectorizationPlanner::getDecisionAndClampRange(
 
 VPlan &LoopVectorizationPlanner::getPlanFor(ElementCount VF, bool TF) const {
   assert(count_if(VPlans,
-                  [VF, TF](const VPlanPtr &Plan) { return Plan->hasVF(VF) && 
Plan->isCompatibleWithTF(TF); }) ==
-             1 &&
+                  [VF, TF](const VPlanPtr &Plan) {
+                    return Plan->hasVF(VF) && Plan->isCompatibleWithTF(TF);
+                  }) == 1 &&
          "Multiple VPlans for VF.");
 
   for (const VPlanPtr &Plan : VPlans) {

``````````

</details>


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

Reply via email to