Skip to content

Commit d066b28

Browse files
committed
formatting fixup
1 parent 95c7af6 commit d066b28

File tree

4 files changed

+17
-14
lines changed

4 files changed

+17
-14
lines changed

llvm/lib/Analysis/IVDescriptors.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1161,8 +1161,8 @@ bool RecurrenceDescriptor::isReductionPHI(PHINode *Phi, Loop *TheLoop,
11611161
<< "\n");
11621162
return true;
11631163
}
1164-
if (AddReductionVar(Phi, RecurKind::FindLast, TheLoop, FMF, RedDes, DB, AC, DT,
1165-
SE)) {
1164+
if (AddReductionVar(Phi, RecurKind::FindLast, TheLoop, FMF, RedDes, DB, AC,
1165+
DT, SE)) {
11661166
LLVM_DEBUG(dbgs() << "Found a FindLast reduction PHI." << *Phi << "\n");
11671167
return true;
11681168
}

llvm/lib/Transforms/Vectorize/LoopVectorize.cpp

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -4549,7 +4549,8 @@ LoopVectorizationPlanner::selectInterleaveCount(VPlan &Plan, ElementCount VF,
45494549

45504550
// FIXME: implement interleaving for FindLast transform correctly.
45514551
for (auto &[_, RdxDesc] : Legal->getReductionVars())
4552-
if (RecurrenceDescriptor::isFindLastRecurrenceKind(RdxDesc.getRecurrenceKind()))
4552+
if (RecurrenceDescriptor::isFindLastRecurrenceKind(
4553+
RdxDesc.getRecurrenceKind()))
45534554
return 1;
45544555

45554556
// If we did not calculate the cost for VF (because the user selected the VF)
@@ -8694,8 +8695,8 @@ VPlanPtr LoopVectorizationPlanner::tryToBuildVPlanWithVPRecipes(
86948695
return nullptr;
86958696

86968697
// Create whole-vector selects for find-last recurrences.
8697-
VPlanTransforms::runPass(VPlanTransforms::convertFindLastRecurrences,
8698-
*Plan, RecipeBuilder, Legal);
8698+
VPlanTransforms::runPass(VPlanTransforms::convertFindLastRecurrences, *Plan,
8699+
RecipeBuilder, Legal);
86998700

87008701
if (useActiveLaneMask(Style)) {
87018702
// TODO: Move checks to VPlanTransforms::addActiveLaneMask once
@@ -8999,7 +9000,7 @@ void LoopVectorizationPlanner::adjustRecipesForReductions(
89999000
Builder.createNaryOp(VPInstruction::ComputeAnyOfResult,
90009001
{PhiR, Start, NewExitingVPV}, ExitDL);
90019002
} else if (RecurrenceDescriptor::isFindLastRecurrenceKind(
9002-
RdxDesc.getRecurrenceKind())) {
9003+
RdxDesc.getRecurrenceKind())) {
90039004
FinalReductionResult = Builder.createNaryOp(
90049005
VPInstruction::ExtractLastActive, {NewExitingVPV}, ExitDL);
90059006
} else {
@@ -10087,9 +10088,10 @@ bool LoopVectorizePass::processLoop(Loop *L) {
1008710088

1008810089
// FIXME: Enable interleaving for last_active reductions.
1008910090
if (any_of(LVL.getReductionVars(), [&](auto &Reduction) -> bool {
10090-
const RecurrenceDescriptor &RdxDesc = Reduction.second;
10091-
return RecurrenceDescriptor::isFindLastRecurrenceKind(RdxDesc.getRecurrenceKind());
10092-
})) {
10091+
const RecurrenceDescriptor &RdxDesc = Reduction.second;
10092+
return RecurrenceDescriptor::isFindLastRecurrenceKind(
10093+
RdxDesc.getRecurrenceKind());
10094+
})) {
1009310095
LLVM_DEBUG(dbgs() << "LV: Not interleaving without vectorization due "
1009410096
<< "to conditional scalar assignments.\n");
1009510097
IntDiagMsg = {

llvm/lib/Transforms/Vectorize/VPlanRecipes.cpp

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1138,8 +1138,9 @@ InstructionCost VPInstruction::computeCost(ElementCount VF,
11381138
Type *ScalarTy = Ctx.Types.inferScalarType(this);
11391139
Type *VecTy = toVectorTy(ScalarTy, VF);
11401140
Type *MaskTy = toVectorTy(Type::getInt1Ty(Ctx.LLVMCtx), VF);
1141-
IntrinsicCostAttributes ICA(Intrinsic::experimental_vector_extract_last_active,
1142-
ScalarTy, {VecTy, MaskTy, ScalarTy});
1141+
IntrinsicCostAttributes ICA(
1142+
Intrinsic::experimental_vector_extract_last_active, ScalarTy,
1143+
{VecTy, MaskTy, ScalarTy});
11431144
return Ctx.TTI.getIntrinsicInstrCost(ICA, Ctx.CostKind);
11441145
}
11451146
case VPInstruction::FirstOrderRecurrenceSplice: {

llvm/lib/Transforms/Vectorize/VPlanTransforms.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4141,9 +4141,9 @@ void VPlanTransforms::addBranchWeightToMiddleTerminator(
41414141
}
41424142

41434143
/// Change CSA reductions to save the appropriate state.
4144-
void VPlanTransforms::convertFindLastRecurrences(VPlan &Plan,
4145-
VPRecipeBuilder &RecipeBuilder,
4146-
LoopVectorizationLegality *Legal) {
4144+
void VPlanTransforms::convertFindLastRecurrences(
4145+
VPlan &Plan, VPRecipeBuilder &RecipeBuilder,
4146+
LoopVectorizationLegality *Legal) {
41474147
assert(Legal && "Need valid LoopVecLegality");
41484148

41494149
// May need to do something better than this?

0 commit comments

Comments
 (0)