[llvm] 24a133e - [LV] Rename CountRoundDown to VectorTripCount (NFC)
Florian Hahn via llvm-commits
llvm-commits at lists.llvm.org
Fri Apr 29 05:50:24 PDT 2022
Author: Ricky Zhou
Date: 2022-04-29T13:50:00+01:00
New Revision: 24a133e16fc50a39e530c7795edabbdf3b2edd2d
URL: https://github.com/llvm/llvm-project/commit/24a133e16fc50a39e530c7795edabbdf3b2edd2d
DIFF: https://github.com/llvm/llvm-project/commit/24a133e16fc50a39e530c7795edabbdf3b2edd2d.diff
LOG: [LV] Rename CountRoundDown to VectorTripCount (NFC)
The name CountRoundDown is potentially misleading, as the number of
iterations can be rounded up when folding the tail.
Reviewed By: fhahn
Differential Revision: https://reviews.llvm.org/D119681
Added:
Modified:
llvm/lib/Transforms/Vectorize/LoopVectorize.cpp
Removed:
################################################################################
diff --git a/llvm/lib/Transforms/Vectorize/LoopVectorize.cpp b/llvm/lib/Transforms/Vectorize/LoopVectorize.cpp
index 783100a150f0..fa95c9caf9e5 100644
--- a/llvm/lib/Transforms/Vectorize/LoopVectorize.cpp
+++ b/llvm/lib/Transforms/Vectorize/LoopVectorize.cpp
@@ -566,7 +566,7 @@ class InnerLoopVectorizer {
/// Set up the values of the IVs correctly when exiting the vector loop.
void fixupIVUsers(PHINode *OrigPhi, const InductionDescriptor &II,
- Value *CountRoundDown, Value *EndValue,
+ Value *VectorTripCount, Value *EndValue,
BasicBlock *MiddleBlock, BasicBlock *VectorHeader);
/// Handle all cross-iteration phis in the header.
@@ -3153,10 +3153,10 @@ void InnerLoopVectorizer::createInductionResumeValues(
Type *StepType = II.getStep()->getType();
Instruction::CastOps CastOp =
CastInst::getCastOpcode(VectorTripCount, true, StepType, true);
- Value *CRD = B.CreateCast(CastOp, VectorTripCount, StepType, "cast.crd");
+ Value *VTC = B.CreateCast(CastOp, VectorTripCount, StepType, "cast.vtc");
Value *Step =
CreateStepValue(II.getStep(), *PSE.getSE(), &*B.GetInsertPoint());
- EndValue = emitTransformedIndex(B, CRD, II.getStartValue(), Step, II);
+ EndValue = emitTransformedIndex(B, VTC, II.getStartValue(), Step, II);
EndValue->setName("ind.end");
// Compute the end value for the additional bypass (if applicable).
@@ -3166,10 +3166,10 @@ void InnerLoopVectorizer::createInductionResumeValues(
StepType, true);
Value *Step =
CreateStepValue(II.getStep(), *PSE.getSE(), &*B.GetInsertPoint());
- CRD =
- B.CreateCast(CastOp, AdditionalBypass.second, StepType, "cast.crd");
+ VTC =
+ B.CreateCast(CastOp, AdditionalBypass.second, StepType, "cast.vtc");
EndValueFromAdditionalBypass =
- emitTransformedIndex(B, CRD, II.getStartValue(), Step, II);
+ emitTransformedIndex(B, VTC, II.getStartValue(), Step, II);
EndValueFromAdditionalBypass->setName("ind.end");
}
}
@@ -3304,7 +3304,7 @@ InnerLoopVectorizer::createVectorizedLoopSkeleton() {
// value for the IV when arriving directly from the middle block.
void InnerLoopVectorizer::fixupIVUsers(PHINode *OrigPhi,
const InductionDescriptor &II,
- Value *CountRoundDown, Value *EndValue,
+ Value *VectorTripCount, Value *EndValue,
BasicBlock *MiddleBlock,
BasicBlock *VectorHeader) {
// There are two kinds of external IV usages - those that use the value
@@ -3342,7 +3342,7 @@ void InnerLoopVectorizer::fixupIVUsers(PHINode *OrigPhi,
B.setFastMathFlags(II.getInductionBinOp()->getFastMathFlags());
Value *CountMinusOne = B.CreateSub(
- CountRoundDown, ConstantInt::get(CountRoundDown->getType(), 1));
+ VectorTripCount, ConstantInt::get(VectorTripCount->getType(), 1));
Value *CMO =
!II.getStep()->getType()->isIntegerTy()
? B.CreateCast(Instruction::SIToFP, CountMinusOne,
@@ -7759,8 +7759,7 @@ EpilogueVectorizerMainLoop::createEpilogueVectorizedLoopSkeleton() {
emitMinimumIterationCountCheck(LoopScalarPreHeader, false);
// Generate the induction variable.
- Value *CountRoundDown = getOrCreateVectorTripCount(LoopVectorPreHeader);
- EPI.VectorTripCount = CountRoundDown;
+ EPI.VectorTripCount = getOrCreateVectorTripCount(LoopVectorPreHeader);
// Skip induction resume value creation here because they will be created in
// the second pass. If we created them here, they wouldn't be used anyway,
More information about the llvm-commits
mailing list