@@ -508,15 +508,6 @@ class InnerLoopVectorizer {
508508 // Return true if any runtime check is added.
509509 bool areSafetyChecksAdded () { return AddedSafetyChecks; }
510510
511- // / A helper function to scalarize a single Instruction in the innermost loop.
512- // / Generates a sequence of scalar instances for each lane between \p MinLane
513- // / and \p MaxLane, times each part between \p MinPart and \p MaxPart,
514- // / inclusive. Uses the VPValue operands from \p RepRecipe instead of \p
515- // / Instr's operands.
516- void scalarizeInstruction (const Instruction *Instr,
517- VPReplicateRecipe *RepRecipe, const VPLane &Lane,
518- VPTransformState &State);
519-
520511 // / Fix the non-induction PHIs in \p Plan.
521512 void fixNonInductionPHIs (VPTransformState &State);
522513
@@ -2321,10 +2312,12 @@ static bool useMaskedInterleavedAccesses(const TargetTransformInfo &TTI) {
23212312 return TTI.enableMaskedInterleavedAccessVectorization ();
23222313}
23232314
2324- void InnerLoopVectorizer::scalarizeInstruction (const Instruction *Instr,
2325- VPReplicateRecipe *RepRecipe,
2326- const VPLane &Lane,
2327- VPTransformState &State) {
2315+ // / A helper function to scalarize a single Instruction in the innermost loop.
2316+ // / Generates a sequence of scalar instances for lane \p Lane. Uses the VPValue
2317+ // / operands from \p RepRecipe instead of \p Instr's operands.
2318+ static void scalarizeInstruction (const Instruction *Instr,
2319+ VPReplicateRecipe *RepRecipe,
2320+ const VPLane &Lane, VPTransformState &State) {
23282321 assert ((!Instr->getType ()->isAggregateType () ||
23292322 canVectorizeTy (Instr->getType ())) &&
23302323 " Expected vectorizable or non-aggregate type." );
@@ -2366,7 +2359,7 @@ void InnerLoopVectorizer::scalarizeInstruction(const Instruction *Instr,
23662359
23672360 // If we just cloned a new assumption, add it the assumption cache.
23682361 if (auto *II = dyn_cast<AssumeInst>(Cloned))
2369- AC->registerAssumption (II);
2362+ State. AC ->registerAssumption (II);
23702363
23712364 assert (
23722365 (RepRecipe->getParent ()->getParent () ||
@@ -7863,7 +7856,7 @@ DenseMap<const SCEV *, Value *> LoopVectorizationPlanner::executePlan(
78637856 *Legal->getWidestInductionType ());
78647857
78657858 // Perform the actual loop transformation.
7866- VPTransformState State (&TTI, BestVF, LI, DT, ILV.Builder , & ILV, &BestVPlan,
7859+ VPTransformState State (&TTI, BestVF, LI, DT, ILV.AC , ILV. Builder , &BestVPlan,
78677860 OrigLoop->getParentLoop (),
78687861 Legal->getWidestInductionType ());
78697862
@@ -10094,7 +10087,7 @@ void VPReplicateRecipe::execute(VPTransformState &State) {
1009410087 assert ((State.VF .isScalar () || !isUniform ()) &&
1009510088 " uniform recipe shouldn't be predicated" );
1009610089 assert (!State.VF .isScalable () && " Can't scalarize a scalable vector" );
10097- State. ILV -> scalarizeInstruction (UI, this , *State.Lane , State);
10090+ scalarizeInstruction (UI, this , *State.Lane , State);
1009810091 // Insert scalar instance packing it into a vector.
1009910092 if (State.VF .isVector () && shouldPack ()) {
1010010093 // If we're constructing lane 0, initialize to start from poison.
@@ -10111,7 +10104,7 @@ void VPReplicateRecipe::execute(VPTransformState &State) {
1011110104
1011210105 if (IsUniform) {
1011310106 // Uniform within VL means we need to generate lane 0.
10114- State. ILV -> scalarizeInstruction (UI, this , VPLane (0 ), State);
10107+ scalarizeInstruction (UI, this , VPLane (0 ), State);
1011510108 return ;
1011610109 }
1011710110
@@ -10120,15 +10113,15 @@ void VPReplicateRecipe::execute(VPTransformState &State) {
1012010113 if (isa<StoreInst>(UI) &&
1012110114 vputils::isUniformAfterVectorization (getOperand (1 ))) {
1012210115 auto Lane = VPLane::getLastLaneForVF (State.VF );
10123- State. ILV -> scalarizeInstruction (UI, this , VPLane (Lane), State);
10116+ scalarizeInstruction (UI, this , VPLane (Lane), State);
1012410117 return ;
1012510118 }
1012610119
1012710120 // Generate scalar instances for all VF lanes.
1012810121 assert (!State.VF .isScalable () && " Can't scalarize a scalable vector" );
1012910122 const unsigned EndLane = State.VF .getKnownMinValue ();
1013010123 for (unsigned Lane = 0 ; Lane < EndLane; ++Lane)
10131- State. ILV -> scalarizeInstruction (UI, this , VPLane (Lane), State);
10124+ scalarizeInstruction (UI, this , VPLane (Lane), State);
1013210125}
1013310126
1013410127// Determine how to lower the scalar epilogue, which depends on 1) optimising
0 commit comments