@@ -801,7 +801,7 @@ static VPValue *optimizeEarlyExitInductionUser(VPlan &Plan,
801801 // Calculate the final index.
802802 VPRegionBlock *LoopRegion = Plan.getVectorLoopRegion ();
803803 auto *CanonicalIV = LoopRegion->getCanonicalIV ();
804- Type *CanonicalIVType = CanonicalIV-> getScalarType ();
804+ Type *CanonicalIVType = LoopRegion-> getCanonicalIVType ();
805805 VPBuilder B (cast<VPBasicBlock>(PredVPBB));
806806
807807 DebugLoc DL = cast<VPInstruction>(Op)->getDebugLoc ();
@@ -2404,8 +2404,8 @@ static VPActiveLaneMaskPHIRecipe *addVPLaneMaskPhiAndUpdateExitBranch(
24042404 " index.part.next" );
24052405
24062406 // Create the active lane mask instruction in the VPlan preheader.
2407- VPValue *ALMMultiplier = Plan. getOrAddLiveIn (
2408- ConstantInt::get (TopRegion->getCanonicalIV ()-> getScalarType (), 1 ));
2407+ VPValue *ALMMultiplier =
2408+ Plan. getOrAddLiveIn ( ConstantInt::get (TopRegion->getCanonicalIVType (), 1 ));
24092409 auto *EntryALM = Builder.createNaryOp (VPInstruction::ActiveLaneMask,
24102410 {EntryIncrement, TC, ALMMultiplier}, DL,
24112411 " active.lane.mask.entry" );
@@ -2491,8 +2491,9 @@ void VPlanTransforms::addActiveLaneMask(
24912491 " UseActiveLaneMaskForControlFlow" );
24922492
24932493 VPRegionBlock *LoopRegion = Plan.getVectorLoopRegion ();
2494- auto *FoundWidenCanonicalIVUser = find_if (
2495- LoopRegion->getCanonicalIV ()->users (), IsaPred<VPWidenCanonicalIVRecipe>);
2494+ auto *CanonicalIV = LoopRegion->getCanonicalIV ();
2495+ auto *FoundWidenCanonicalIVUser =
2496+ find_if (CanonicalIV->users (), IsaPred<VPWidenCanonicalIVRecipe>);
24962497 assert (FoundWidenCanonicalIVUser &&
24972498 " Must have widened canonical IV when tail folding!" );
24982499 VPSingleDefRecipe *HeaderMask = findHeaderMask (Plan);
@@ -2505,7 +2506,7 @@ void VPlanTransforms::addActiveLaneMask(
25052506 } else {
25062507 VPBuilder B = VPBuilder::getToInsertAfter (WideCanonicalIV);
25072508 VPValue *ALMMultiplier = Plan.getOrAddLiveIn (
2508- ConstantInt::get (LoopRegion->getCanonicalIV ()-> getScalarType (), 1 ));
2509+ ConstantInt::get (LoopRegion->getCanonicalIVType (), 1 ));
25092510 LaneMask =
25102511 B.createNaryOp (VPInstruction::ActiveLaneMask,
25112512 {WideCanonicalIV, Plan.getTripCount (), ALMMultiplier},
@@ -2777,7 +2778,7 @@ void VPlanTransforms::addExplicitVectorLength(
27772778 VPBasicBlock *Header = LoopRegion->getEntryBasicBlock ();
27782779
27792780 auto *CanonicalIVPHI = LoopRegion->getCanonicalIV ();
2780- auto *CanIVTy = CanonicalIVPHI-> getScalarType ();
2781+ auto *CanIVTy = LoopRegion-> getCanonicalIVType ();
27812782 VPValue *StartV = CanonicalIVPHI->getStartValue ();
27822783
27832784 // Create the ExplicitVectorLengthPhi recipe in the main loop.
@@ -4295,10 +4296,10 @@ void VPlanTransforms::narrowInterleaveGroups(VPlan &Plan, ElementCount VF,
42954296 VPBuilder PHBuilder (Plan.getVectorPreheader ());
42964297
42974298 VPValue *UF = Plan.getOrAddLiveIn (
4298- ConstantInt::get (CanIV-> getScalarType (), 1 * Plan.getUF ()));
4299+ ConstantInt::get (VectorLoop-> getCanonicalIVType (), 1 * Plan.getUF ()));
42994300 if (VF.isScalable ()) {
43004301 VPValue *VScale = PHBuilder.createElementCount (
4301- CanIV-> getScalarType (), ElementCount::getScalable (1 ));
4302+ VectorLoop-> getCanonicalIVType (), ElementCount::getScalable (1 ));
43024303 VPValue *VScaleUF = PHBuilder.createNaryOp (Instruction::Mul, {VScale, UF});
43034304 Inc->setOperand (1 , VScaleUF);
43044305 Plan.getVF ().replaceAllUsesWith (VScale);
0 commit comments