[llvm] [LV] Rename replaceMaskWithCompare -> replaceMaskWithCompareForScalarPlan (PR #216340)
via llvm-commits
llvm-commits at lists.llvm.org
Fri Aug 14 08:34:05 PDT 2026
llvmorg-github-actions[bot] wrote:
<!--LLVM PR SUMMARY COMMENT-->
@llvm/pr-subscribers-vectorizers
Author: Kerry McLaughlin (kmclaughlin-arm)
<details>
<summary>Changes</summary>
---
Full diff: https://github.com/llvm/llvm-project/pull/216340.diff
2 Files Affected:
- (modified) llvm/lib/Transforms/Vectorize/VPlan.h (+3-3)
- (modified) llvm/lib/Transforms/Vectorize/VPlanTransforms.cpp (+3-2)
``````````diff
diff --git a/llvm/lib/Transforms/Vectorize/VPlan.h b/llvm/lib/Transforms/Vectorize/VPlan.h
index 746e918a3f1df..79ac7bf307f5d 100644
--- a/llvm/lib/Transforms/Vectorize/VPlan.h
+++ b/llvm/lib/Transforms/Vectorize/VPlan.h
@@ -1242,9 +1242,9 @@ class LLVM_ABI_FOR_TEST VPInstruction : public VPRecipeWithIRFlags,
// Creates a mask where each lane is active (true) whilst the current
// counter (first operand + index) is less than the second operand. i.e.
// mask[i] = icmpt ult (op0 + i), op1
- // ActiveLaneMask is used for tail-folding, with the exception of the
- // DataAndControlFlow style. The size of the mask returned is VF.
- // When unrolled, ActiveLaneMask is duplicated.
+ // ActiveLaneMask is used for early-exit loops with stores, plus tail
+ // folding for all styles except DataAndControlFlow. The size of the
+ // mask returned is VF. When unrolled, ActiveLaneMask is duplicated.
ActiveLaneMask,
// As above, but takes an additional operand (Multiplier). The size of
// the mask returned is VF * Multiplier (UF, op2).
diff --git a/llvm/lib/Transforms/Vectorize/VPlanTransforms.cpp b/llvm/lib/Transforms/Vectorize/VPlanTransforms.cpp
index 79eb6f4561f8f..5e82133f10228 100644
--- a/llvm/lib/Transforms/Vectorize/VPlanTransforms.cpp
+++ b/llvm/lib/Transforms/Vectorize/VPlanTransforms.cpp
@@ -2040,7 +2040,8 @@ static bool isConditionTrueViaVFAndUF(VPValue *Cond, VPlan &Plan,
// Replaces ExtractVectorForPart instructions with ICMP when the VF is scalar
// and the source is a WideActiveLaneMask. The unused mask is removed later
// when removing dead recipes.
-static bool replaceMaskWithCompare(VPlan &Plan, ElementCount BestVF) {
+static bool replaceMaskWithCompareForScalarPlan(VPlan &Plan,
+ ElementCount BestVF) {
if (!BestVF.isScalar())
return false;
@@ -2142,7 +2143,7 @@ void VPlanTransforms::optimizeForVFAndUF(VPlan &Plan, ElementCount BestVF,
assert(Plan.hasVF(BestVF) && "BestVF is not available in Plan");
assert(Plan.hasUF(BestUF) && "BestUF is not available in Plan");
- bool MadeChange = replaceMaskWithCompare(Plan, BestVF);
+ bool MadeChange = replaceMaskWithCompareForScalarPlan(Plan, BestVF);
MadeChange |= simplifyBranchConditionForVFAndUF(Plan, BestVF, BestUF, PSE);
MadeChange |= optimizeVectorInductionWidthForTCAndVFUF(Plan, BestVF, BestUF);
``````````
</details>
https://github.com/llvm/llvm-project/pull/216340
More information about the llvm-commits
mailing list