@@ -505,8 +505,7 @@ class InnerLoopVectorizer {
505
505
// / inclusive. Uses the VPValue operands from \p RepRecipe instead of \p
506
506
// / Instr's operands.
507
507
void scalarizeInstruction (const Instruction *Instr,
508
- VPReplicateRecipe *RepRecipe,
509
- const VPIteration &Instance,
508
+ VPReplicateRecipe *RepRecipe, const VPLane &Lane,
510
509
VPTransformState &State);
511
510
512
511
// / Fix the non-induction PHIs in \p Plan.
@@ -2322,14 +2321,14 @@ static bool useMaskedInterleavedAccesses(const TargetTransformInfo &TTI) {
2322
2321
2323
2322
void InnerLoopVectorizer::scalarizeInstruction (const Instruction *Instr,
2324
2323
VPReplicateRecipe *RepRecipe,
2325
- const VPIteration &Instance ,
2324
+ const VPLane &Lane ,
2326
2325
VPTransformState &State) {
2327
2326
assert (!Instr->getType ()->isAggregateType () && " Can't handle vectors" );
2328
2327
2329
2328
// llvm.experimental.noalias.scope.decl intrinsics must only be duplicated for
2330
2329
// the first lane and part.
2331
2330
if (isa<NoAliasScopeDeclInst>(Instr))
2332
- if (!Instance. isFirstIteration ())
2331
+ if (!Lane. isFirstLane ())
2333
2332
return ;
2334
2333
2335
2334
// Does this instruction return a value ?
@@ -2354,18 +2353,18 @@ void InnerLoopVectorizer::scalarizeInstruction(const Instruction *Instr,
2354
2353
// Replace the operands of the cloned instructions with their scalar
2355
2354
// equivalents in the new loop.
2356
2355
for (const auto &I : enumerate(RepRecipe->operands ())) {
2357
- auto InputInstance = Instance ;
2356
+ auto InputLane = Lane ;
2358
2357
VPValue *Operand = I.value ();
2359
2358
if (vputils::isUniformAfterVectorization (Operand))
2360
- InputInstance. Lane = VPLane::getFirstLane ();
2361
- Cloned->setOperand (I.index (), State.get (Operand, InputInstance ));
2359
+ InputLane = VPLane::getFirstLane ();
2360
+ Cloned->setOperand (I.index (), State.get (Operand, InputLane ));
2362
2361
}
2363
2362
State.addNewMetadata (Cloned, Instr);
2364
2363
2365
2364
// Place the cloned scalar in the new loop.
2366
2365
State.Builder .Insert (Cloned);
2367
2366
2368
- State.set (RepRecipe, Cloned, Instance );
2367
+ State.set (RepRecipe, Cloned, Lane );
2369
2368
2370
2369
// If we just cloned a new assumption, add it the assumption cache.
2371
2370
if (auto *II = dyn_cast<AssumeInst>(Cloned))
@@ -2784,7 +2783,7 @@ void InnerLoopVectorizer::fixupIVUsers(PHINode *OrigPhi,
2784
2783
VPValue *StepVPV = Plan.getSCEVExpansion (II.getStep ());
2785
2784
assert (StepVPV && " step must have been expanded during VPlan execution" );
2786
2785
Value *Step = StepVPV->isLiveIn () ? StepVPV->getLiveInIRValue ()
2787
- : State.get (StepVPV, { 0 , 0 } );
2786
+ : State.get (StepVPV, VPLane ( 0 ) );
2788
2787
Value *Escape =
2789
2788
emitTransformedIndex (B, CountMinusOne, II.getStartValue (), Step,
2790
2789
II.getKind (), II.getInductionBinOp ());
@@ -7435,8 +7434,7 @@ static void createAndCollectMergePhiForReduction(
7435
7434
auto *PhiR = cast<VPReductionPHIRecipe>(RedResult->getOperand (0 ));
7436
7435
const RecurrenceDescriptor &RdxDesc = PhiR->getRecurrenceDescriptor ();
7437
7436
7438
- Value *FinalValue =
7439
- State.get (RedResult, VPIteration (0 , VPLane::getFirstLane ()));
7437
+ Value *FinalValue = State.get (RedResult, VPLane (VPLane::getFirstLane ()));
7440
7438
auto *ResumePhi =
7441
7439
dyn_cast<PHINode>(PhiR->getStartValue ()->getUnderlyingValue ());
7442
7440
if (VectorizingEpilogue && RecurrenceDescriptor::isAnyOfRecurrenceKind (
@@ -7525,7 +7523,7 @@ LoopVectorizationPlanner::executePlan(
7525
7523
BestVPlan.getPreheader ()->execute (&State);
7526
7524
}
7527
7525
if (!ILV.getTripCount ())
7528
- ILV.setTripCount (State.get (BestVPlan.getTripCount (), { 0 , 0 } ));
7526
+ ILV.setTripCount (State.get (BestVPlan.getTripCount (), VPLane ( 0 ) ));
7529
7527
else
7530
7528
assert (IsEpilogueVectorization && " should only re-use the existing trip "
7531
7529
" count during epilogue vectorization" );
@@ -9409,48 +9407,48 @@ void LoopVectorizationPlanner::adjustRecipesForReductions(
9409
9407
}
9410
9408
9411
9409
void VPDerivedIVRecipe::execute (VPTransformState &State) {
9412
- assert (!State.Instance && " VPDerivedIVRecipe being replicated." );
9410
+ assert (!State.Lane && " VPDerivedIVRecipe being replicated." );
9413
9411
9414
9412
// Fast-math-flags propagate from the original induction instruction.
9415
9413
IRBuilder<>::FastMathFlagGuard FMFG (State.Builder );
9416
9414
if (FPBinOp)
9417
9415
State.Builder .setFastMathFlags (FPBinOp->getFastMathFlags ());
9418
9416
9419
- Value *Step = State.get (getStepValue (), VPIteration ( 0 , 0 ));
9420
- Value *CanonicalIV = State.get (getOperand (1 ), VPIteration ( 0 , 0 ));
9417
+ Value *Step = State.get (getStepValue (), VPLane ( 0 ));
9418
+ Value *CanonicalIV = State.get (getOperand (1 ), VPLane ( 0 ));
9421
9419
Value *DerivedIV = emitTransformedIndex (
9422
9420
State.Builder , CanonicalIV, getStartValue ()->getLiveInIRValue (), Step,
9423
9421
Kind, cast_if_present<BinaryOperator>(FPBinOp));
9424
9422
DerivedIV->setName (" offset.idx" );
9425
9423
assert (DerivedIV != CanonicalIV && " IV didn't need transforming?" );
9426
9424
9427
- State.set (this , DerivedIV, VPIteration ( 0 , 0 ));
9425
+ State.set (this , DerivedIV, VPLane ( 0 ));
9428
9426
}
9429
9427
9430
9428
void VPReplicateRecipe::execute (VPTransformState &State) {
9431
9429
Instruction *UI = getUnderlyingInstr ();
9432
- if (State.Instance ) { // Generate a single instance.
9430
+ if (State.Lane ) { // Generate a single instance.
9433
9431
assert ((State.VF .isScalar () || !isUniform ()) &&
9434
9432
" uniform recipe shouldn't be predicated" );
9435
9433
assert (!State.VF .isScalable () && " Can't scalarize a scalable vector" );
9436
- State.ILV ->scalarizeInstruction (UI, this , *State.Instance , State);
9434
+ State.ILV ->scalarizeInstruction (UI, this , *State.Lane , State);
9437
9435
// Insert scalar instance packing it into a vector.
9438
9436
if (State.VF .isVector () && shouldPack ()) {
9439
9437
// If we're constructing lane 0, initialize to start from poison.
9440
- if (State.Instance -> Lane . isFirstLane ()) {
9438
+ if (State.Lane -> isFirstLane ()) {
9441
9439
assert (!State.VF .isScalable () && " VF is assumed to be non scalable." );
9442
9440
Value *Poison = PoisonValue::get (
9443
9441
VectorType::get (UI->getType (), State.VF ));
9444
9442
State.set (this , Poison);
9445
9443
}
9446
- State.packScalarIntoVectorValue (this , *State.Instance );
9444
+ State.packScalarIntoVectorValue (this , *State.Lane );
9447
9445
}
9448
9446
return ;
9449
9447
}
9450
9448
9451
9449
if (IsUniform) {
9452
9450
// Uniform within VL means we need to generate lane 0.
9453
- State.ILV ->scalarizeInstruction (UI, this , VPIteration ( 0 , 0 ), State);
9451
+ State.ILV ->scalarizeInstruction (UI, this , VPLane ( 0 ), State);
9454
9452
return ;
9455
9453
}
9456
9454
@@ -9459,15 +9457,15 @@ void VPReplicateRecipe::execute(VPTransformState &State) {
9459
9457
if (isa<StoreInst>(UI) &&
9460
9458
vputils::isUniformAfterVectorization (getOperand (1 ))) {
9461
9459
auto Lane = VPLane::getLastLaneForVF (State.VF );
9462
- State.ILV ->scalarizeInstruction (UI, this , VPIteration ( 0 , Lane), State);
9460
+ State.ILV ->scalarizeInstruction (UI, this , VPLane ( Lane), State);
9463
9461
return ;
9464
9462
}
9465
9463
9466
9464
// Generate scalar instances for all VF lanes.
9467
9465
assert (!State.VF .isScalable () && " Can't scalarize a scalable vector" );
9468
9466
const unsigned EndLane = State.VF .getKnownMinValue ();
9469
9467
for (unsigned Lane = 0 ; Lane < EndLane; ++Lane)
9470
- State.ILV ->scalarizeInstruction (UI, this , VPIteration ( 0 , Lane), State);
9468
+ State.ILV ->scalarizeInstruction (UI, this , VPLane ( Lane), State);
9471
9469
}
9472
9470
9473
9471
// Determine how to lower the scalar epilogue, which depends on 1) optimising
0 commit comments