@@ -508,15 +508,6 @@ class InnerLoopVectorizer {
508
508
// Return true if any runtime check is added.
509
509
bool areSafetyChecksAdded () { return AddedSafetyChecks; }
510
510
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
-
520
511
// / Fix the non-induction PHIs in \p Plan.
521
512
void fixNonInductionPHIs (VPTransformState &State);
522
513
@@ -2321,10 +2312,12 @@ static bool useMaskedInterleavedAccesses(const TargetTransformInfo &TTI) {
2321
2312
return TTI.enableMaskedInterleavedAccessVectorization ();
2322
2313
}
2323
2314
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) {
2328
2321
assert ((!Instr->getType ()->isAggregateType () ||
2329
2322
canVectorizeTy (Instr->getType ())) &&
2330
2323
" Expected vectorizable or non-aggregate type." );
@@ -2366,7 +2359,7 @@ void InnerLoopVectorizer::scalarizeInstruction(const Instruction *Instr,
2366
2359
2367
2360
// If we just cloned a new assumption, add it the assumption cache.
2368
2361
if (auto *II = dyn_cast<AssumeInst>(Cloned))
2369
- AC->registerAssumption (II);
2362
+ State. AC ->registerAssumption (II);
2370
2363
2371
2364
assert (
2372
2365
(RepRecipe->getParent ()->getParent () ||
@@ -7863,7 +7856,7 @@ DenseMap<const SCEV *, Value *> LoopVectorizationPlanner::executePlan(
7863
7856
*Legal->getWidestInductionType ());
7864
7857
7865
7858
// 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,
7867
7860
OrigLoop->getParentLoop (),
7868
7861
Legal->getWidestInductionType ());
7869
7862
@@ -10094,7 +10087,7 @@ void VPReplicateRecipe::execute(VPTransformState &State) {
10094
10087
assert ((State.VF .isScalar () || !isUniform ()) &&
10095
10088
" uniform recipe shouldn't be predicated" );
10096
10089
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);
10098
10091
// Insert scalar instance packing it into a vector.
10099
10092
if (State.VF .isVector () && shouldPack ()) {
10100
10093
// If we're constructing lane 0, initialize to start from poison.
@@ -10111,7 +10104,7 @@ void VPReplicateRecipe::execute(VPTransformState &State) {
10111
10104
10112
10105
if (IsUniform) {
10113
10106
// 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);
10115
10108
return ;
10116
10109
}
10117
10110
@@ -10120,15 +10113,15 @@ void VPReplicateRecipe::execute(VPTransformState &State) {
10120
10113
if (isa<StoreInst>(UI) &&
10121
10114
vputils::isUniformAfterVectorization (getOperand (1 ))) {
10122
10115
auto Lane = VPLane::getLastLaneForVF (State.VF );
10123
- State. ILV -> scalarizeInstruction (UI, this , VPLane (Lane), State);
10116
+ scalarizeInstruction (UI, this , VPLane (Lane), State);
10124
10117
return ;
10125
10118
}
10126
10119
10127
10120
// Generate scalar instances for all VF lanes.
10128
10121
assert (!State.VF .isScalable () && " Can't scalarize a scalable vector" );
10129
10122
const unsigned EndLane = State.VF .getKnownMinValue ();
10130
10123
for (unsigned Lane = 0 ; Lane < EndLane; ++Lane)
10131
- State. ILV -> scalarizeInstruction (UI, this , VPLane (Lane), State);
10124
+ scalarizeInstruction (UI, this , VPLane (Lane), State);
10132
10125
}
10133
10126
10134
10127
// Determine how to lower the scalar epilogue, which depends on 1) optimising
0 commit comments