[llvm] 3fbf6f8 - [LV] Remove more references of unrolled parts after 57f5d8f2fe.
Florian Hahn via llvm-commits
llvm-commits at lists.llvm.org
Tue Sep 24 07:50:57 PDT 2024
Author: Florian Hahn
Date: 2024-09-24T15:50:31+01:00
New Revision: 3fbf6f8bb183ad8b9157e50c442479f4ca7a9b8d
URL: https://github.com/llvm/llvm-project/commit/3fbf6f8bb183ad8b9157e50c442479f4ca7a9b8d
DIFF: https://github.com/llvm/llvm-project/commit/3fbf6f8bb183ad8b9157e50c442479f4ca7a9b8d.diff
LOG: [LV] Remove more references of unrolled parts after 57f5d8f2fe.
Continue to clean up some now stale references of unroll parts and
related terminology as pointed out post-commit for 06c3a7d.
Added:
Modified:
llvm/lib/Transforms/Vectorize/LoopVectorize.cpp
llvm/lib/Transforms/Vectorize/VPlan.cpp
llvm/lib/Transforms/Vectorize/VPlan.h
llvm/lib/Transforms/Vectorize/VPlanRecipes.cpp
Removed:
################################################################################
diff --git a/llvm/lib/Transforms/Vectorize/LoopVectorize.cpp b/llvm/lib/Transforms/Vectorize/LoopVectorize.cpp
index 0566d80c1cc001..d296511b977992 100644
--- a/llvm/lib/Transforms/Vectorize/LoopVectorize.cpp
+++ b/llvm/lib/Transforms/Vectorize/LoopVectorize.cpp
@@ -538,12 +538,6 @@ class InnerLoopVectorizer {
/// A small list of PHINodes.
using PhiVector = SmallVector<PHINode *, 4>;
- /// A type for scalarized values in the new loop. Each value from the
- /// original loop, when scalarized, is represented by UF x VF scalar values
- /// in the new unrolled loop, where UF is the unroll factor and VF is the
- /// vectorization factor.
- using ScalarParts = SmallVector<SmallVector<Value *, 4>, 2>;
-
/// Set up the values of the IVs correctly when exiting the vector loop.
void fixupIVUsers(PHINode *OrigPhi, const InductionDescriptor &II,
Value *VectorTripCount, Value *EndValue,
diff --git a/llvm/lib/Transforms/Vectorize/VPlan.cpp b/llvm/lib/Transforms/Vectorize/VPlan.cpp
index ce15b2783cc457..5e4d487261c6f0 100644
--- a/llvm/lib/Transforms/Vectorize/VPlan.cpp
+++ b/llvm/lib/Transforms/Vectorize/VPlan.cpp
@@ -333,10 +333,10 @@ Value *VPTransformState::get(VPValue *Def, bool NeedsScalar) {
// However, if we are vectorizing, we need to construct the vector values.
// If the value is known to be uniform after vectorization, we can just
- // broadcast the scalar value corresponding to lane zero for each unroll
- // iteration. Otherwise, we construct the vector values using
- // insertelement instructions. Since the resulting vectors are stored in
- // State, we will only generate the insertelements once.
+ // broadcast the scalar value corresponding to lane zero. Otherwise, we
+ // construct the vector values using insertelement instructions. Since the
+ // resulting vectors are stored in State, we will only generate the
+ // insertelements once.
Value *VectorValue = nullptr;
if (IsUniform) {
VectorValue = GetBroadcastInstrs(ScalarValue);
@@ -769,15 +769,15 @@ void VPRegionBlock::execute(VPTransformState *State) {
// Enter replicating mode.
State->Instance = VPIteration(0, 0);
- assert(!State->VF.isScalable() && "VF is assumed to be non scalable.");
- for (unsigned Lane = 0, VF = State->VF.getKnownMinValue(); Lane < VF;
- ++Lane) {
- State->Instance->Lane = VPLane(Lane, VPLane::Kind::First);
- // Visit the VPBlocks connected to \p this, starting from it.
- for (VPBlockBase *Block : RPOT) {
- LLVM_DEBUG(dbgs() << "LV: VPBlock in RPO " << Block->getName() << '\n');
- Block->execute(State);
- }
+ assert(!State->VF.isScalable() && "VF is assumed to be non scalable.");
+ for (unsigned Lane = 0, VF = State->VF.getKnownMinValue(); Lane < VF;
+ ++Lane) {
+ State->Instance->Lane = VPLane(Lane, VPLane::Kind::First);
+ // Visit the VPBlocks connected to \p this, starting from it.
+ for (VPBlockBase *Block : RPOT) {
+ LLVM_DEBUG(dbgs() << "LV: VPBlock in RPO " << Block->getName() << '\n');
+ Block->execute(State);
+ }
}
// Exit replicating mode.
diff --git a/llvm/lib/Transforms/Vectorize/VPlan.h b/llvm/lib/Transforms/Vectorize/VPlan.h
index 0632495bc511cd..c886a39aec76e5 100644
--- a/llvm/lib/Transforms/Vectorize/VPlan.h
+++ b/llvm/lib/Transforms/Vectorize/VPlan.h
@@ -254,7 +254,7 @@ struct VPTransformState {
DominatorTree *DT, IRBuilderBase &Builder,
InnerLoopVectorizer *ILV, VPlan *Plan);
- /// The chosen Vectorization and Unroll Factors of the loop being vectorized.
+ /// The chosen Vectorization Factor of the loop being vectorized.
ElementCount VF;
/// Hold the indices to generate specific scalar instructions. Null indicates
@@ -1253,9 +1253,7 @@ class VPInstruction : public VPRecipeWithIRFlags,
ComputeReductionResult,
// Takes the VPValue to extract from as first operand and the lane or part
// to extract as second operand, counting from the end starting with 1 for
- // last. The second operand must be a positive constant and <= VF when
- // extracting from a vector or <= UF when extracting from an unrolled
- // scalar.
+ // last. The second operand must be a positive constant and <= VF.
ExtractFromEnd,
LogicalAnd, // Non-poison propagating logical And.
// Add an offset in bytes (second operand) to a base pointer (first
diff --git a/llvm/lib/Transforms/Vectorize/VPlanRecipes.cpp b/llvm/lib/Transforms/Vectorize/VPlanRecipes.cpp
index 318d6a8c5b8c34..f33293e65010f9 100644
--- a/llvm/lib/Transforms/Vectorize/VPlanRecipes.cpp
+++ b/llvm/lib/Transforms/Vectorize/VPlanRecipes.cpp
@@ -2490,9 +2490,7 @@ void VPInterleaveRecipe::execute(VPTransformState &State) {
// If the group is reverse, adjust the index to refer to the last vector lane
// instead of the first. We adjust the index from the first vector lane,
// rather than directly getting the pointer for lane VF - 1, because the
- // pointer operand of the interleaved access is supposed to be uniform. For
- // uniform instructions, we're only required to generate a value for the
- // first vector lane in each unroll iteration.
+ // pointer operand of the interleaved access is supposed to be uniform.
if (Group->isReverse()) {
Value *RuntimeVF =
getRuntimeVF(State.Builder, State.Builder.getInt32Ty(), State.VF);
More information about the llvm-commits
mailing list