@@ -7548,7 +7548,7 @@ DenseMap<const SCEV *, Value *> LoopVectorizationPlanner::executePlan(
7548
7548
// TODO: Move to VPlan transform stage once the transition to the VPlan-based
7549
7549
// cost model is complete for better cost estimates.
7550
7550
VPlanTransforms::unrollByUF (BestVPlan, BestUF,
7551
- OrigLoop->getHeader ()->getModule ()-> getContext ());
7551
+ OrigLoop->getHeader ()->getContext ());
7552
7552
VPlanTransforms::optimizeForVFAndUF (BestVPlan, BestVF, BestUF, PSE);
7553
7553
7554
7554
LLVM_DEBUG (dbgs () << " Executing best plan with VF=" << BestVF
@@ -8378,8 +8378,8 @@ VPSingleDefRecipe *VPRecipeBuilder::tryToWidenCall(CallInst *CI,
8378
8378
if (Legal->isMaskRequired (CI))
8379
8379
Mask = getBlockInMask (CI->getParent ());
8380
8380
else
8381
- Mask = Plan.getOrAddLiveIn (ConstantInt::getTrue (
8382
- IntegerType::getInt1Ty (Variant-> getFunctionType () ->getContext ())));
8381
+ Mask = Plan.getOrAddLiveIn (
8382
+ ConstantInt::getTrue ( IntegerType::getInt1Ty (CI ->getContext ())));
8383
8383
8384
8384
Ops.insert (Ops.begin () + *MaskPos, Mask);
8385
8385
}
@@ -8753,8 +8753,6 @@ addUsersInExitBlock(VPlan &Plan,
8753
8753
8754
8754
auto *MiddleVPBB =
8755
8755
cast<VPBasicBlock>(Plan.getVectorLoopRegion ()->getSingleSuccessor ());
8756
- BasicBlock *ExitBB =
8757
- cast<VPIRBasicBlock>(MiddleVPBB->getSuccessors ()[0 ])->getIRBasicBlock ();
8758
8756
VPBuilder B (MiddleVPBB, MiddleVPBB->getFirstNonPhi ());
8759
8757
8760
8758
// Introduce extract for exiting values and update the VPIRInstructions
@@ -8765,10 +8763,10 @@ addUsersInExitBlock(VPlan &Plan,
8765
8763
if (V->isLiveIn ())
8766
8764
continue ;
8767
8765
8768
- VPValue *Ext = B. createNaryOp (
8769
- VPInstruction::ExtractFromEnd,
8770
- {V, Plan.getOrAddLiveIn (ConstantInt::get (
8771
- IntegerType::get (ExitBB-> getContext () , 32 ), 1 ))});
8766
+ LLVMContext &Ctx = ExitIRI-> getInstruction (). getContext ();
8767
+ VPValue *Ext = B. createNaryOp ( VPInstruction::ExtractFromEnd,
8768
+ {V, Plan.getOrAddLiveIn (ConstantInt::get (
8769
+ IntegerType::get (Ctx , 32 ), 1 ))});
8772
8770
ExitIRI->setOperand (0 , Ext);
8773
8771
}
8774
8772
}
0 commit comments