@@ -820,7 +820,7 @@ static VPValue *optimizeEarlyExitInductionUser(VPlan &Plan,
820820  //  Calculate the final index.
821821  VPRegionBlock *LoopRegion = Plan.getVectorLoopRegion ();
822822  auto  *CanonicalIV = LoopRegion->getCanonicalIV ();
823-   Type *CanonicalIVType = CanonicalIV-> getScalarType ();
823+   Type *CanonicalIVType = LoopRegion-> getCanonicalIVType ();
824824  VPBuilder B (cast<VPBasicBlock>(PredVPBB));
825825
826826  DebugLoc DL = cast<VPInstruction>(Op)->getDebugLoc ();
@@ -2402,8 +2402,8 @@ static VPActiveLaneMaskPHIRecipe *addVPLaneMaskPhiAndUpdateExitBranch(
24022402      " index.part.next"  );
24032403
24042404  //  Create the active lane mask instruction in the VPlan preheader.
2405-   VPValue *ALMMultiplier = Plan. getOrAddLiveIn ( 
2406-       ConstantInt::get (TopRegion->getCanonicalIV ()-> getScalarType (), 1 ));
2405+   VPValue *ALMMultiplier =
2406+       Plan. getOrAddLiveIn ( ConstantInt::get (TopRegion->getCanonicalIVType (), 1 ));
24072407  auto  *EntryALM = Builder.createNaryOp (VPInstruction::ActiveLaneMask,
24082408                                        {EntryIncrement, TC, ALMMultiplier}, DL,
24092409                                        " active.lane.mask.entry"  );
@@ -2503,7 +2503,7 @@ void VPlanTransforms::addActiveLaneMask(
25032503  } else  {
25042504    VPBuilder B = VPBuilder::getToInsertAfter (WideCanonicalIV);
25052505    VPValue *ALMMultiplier = Plan.getOrAddLiveIn (
2506-         ConstantInt::get (LoopRegion->getCanonicalIV ()-> getScalarType (), 1 ));
2506+         ConstantInt::get (LoopRegion->getCanonicalIVType (), 1 ));
25072507    LaneMask =
25082508        B.createNaryOp (VPInstruction::ActiveLaneMask,
25092509                       {WideCanonicalIV, Plan.getTripCount (), ALMMultiplier},
@@ -2775,7 +2775,7 @@ void VPlanTransforms::addExplicitVectorLength(
27752775  VPBasicBlock *Header = LoopRegion->getEntryBasicBlock ();
27762776
27772777  auto  *CanonicalIVPHI = LoopRegion->getCanonicalIV ();
2778-   auto  *CanIVTy = CanonicalIVPHI-> getScalarType ();
2778+   auto  *CanIVTy = LoopRegion-> getCanonicalIVType ();
27792779  VPValue *StartV = CanonicalIVPHI->getStartValue ();
27802780
27812781  //  Create the ExplicitVectorLengthPhi recipe in the main loop.
@@ -4336,10 +4336,10 @@ void VPlanTransforms::narrowInterleaveGroups(VPlan &Plan, ElementCount VF,
43364336  VPBuilder PHBuilder (Plan.getVectorPreheader ());
43374337
43384338  VPValue *UF = Plan.getOrAddLiveIn (
4339-       ConstantInt::get (CanIV-> getScalarType (), 1  * Plan.getUF ()));
4339+       ConstantInt::get (VectorLoop-> getCanonicalIVType (), 1  * Plan.getUF ()));
43404340  if  (VF.isScalable ()) {
43414341    VPValue *VScale = PHBuilder.createElementCount (
4342-         CanIV-> getScalarType (), ElementCount::getScalable (1 ));
4342+         VectorLoop-> getCanonicalIVType (), ElementCount::getScalable (1 ));
43434343    VPValue *VScaleUF = PHBuilder.createNaryOp (Instruction::Mul, {VScale, UF});
43444344    Inc->setOperand (1 , VScaleUF);
43454345    Plan.getVF ().replaceAllUsesWith (VScale);
0 commit comments