[llvm] e33cbe0 - [LV] Rename replaceMaskWithCompare -> replaceMaskWithCompareForScalarPlan (#216340)
via llvm-commits
llvm-commits at lists.llvm.org
Mon Aug 24 05:15:55 PDT 2026
Author: Kerry McLaughlin
Date: 2026-08-24T13:15:50+01:00
New Revision: e33cbe0b35bc36c1e94ce0ad1d8bd4ca939d6561
URL: https://github.com/llvm/llvm-project/commit/e33cbe0b35bc36c1e94ce0ad1d8bd4ca939d6561
DIFF: https://github.com/llvm/llvm-project/commit/e33cbe0b35bc36c1e94ce0ad1d8bd4ca939d6561.diff
LOG: [LV] Rename replaceMaskWithCompare -> replaceMaskWithCompareForScalarPlan (#216340)
Added:
Modified:
llvm/lib/Transforms/Vectorize/VPlan.h
llvm/lib/Transforms/Vectorize/VPlanTransforms.cpp
Removed:
################################################################################
diff --git a/llvm/lib/Transforms/Vectorize/VPlan.h b/llvm/lib/Transforms/Vectorize/VPlan.h
index deabeb97183c2..fe1342e4309ab 100644
--- a/llvm/lib/Transforms/Vectorize/VPlan.h
+++ b/llvm/lib/Transforms/Vectorize/VPlan.h
@@ -1243,9 +1243,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 6eaf8a4ac2e68..9027846fa54f9 100644
--- a/llvm/lib/Transforms/Vectorize/VPlanTransforms.cpp
+++ b/llvm/lib/Transforms/Vectorize/VPlanTransforms.cpp
@@ -2046,7 +2046,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;
@@ -2150,7 +2151,7 @@ void VPlanTransforms::optimizeForVFAndUF(VPlan &Plan, ElementCount BestVF,
bool MadeChange =
simplifyBranchConditionForVFAndUF(Plan, BestVF, BestUF, PSE);
- MadeChange |= replaceMaskWithCompare(Plan, BestVF);
+ MadeChange |= replaceMaskWithCompareForScalarPlan(Plan, BestVF);
MadeChange |= optimizeVectorInductionWidthForTCAndVFUF(Plan, BestVF, BestUF);
if (MadeChange) {
More information about the llvm-commits
mailing list