@@ -4344,12 +4344,11 @@ bool LoopVectorizationPlanner::isMoreProfitable(
43444344void LoopVectorizationPlanner::emitInvalidCostRemarks (
43454345 OptimizationRemarkEmitter *ORE) {
43464346 using RecipeVFPair = std::pair<VPRecipeBase *, ElementCount>;
4347- LLVMContext &LLVMCtx = OrigLoop->getHeader ()->getContext ();
43484347 SmallVector<RecipeVFPair> InvalidCosts;
43494348 for (const auto &Plan : VPlans) {
43504349 for (ElementCount VF : Plan->vectorFactors ()) {
43514350 VPCostContext CostCtx (CM.TTI , *CM.TLI , Legal->getWidestInductionType (),
4352- LLVMCtx, CM);
4351+ CM);
43534352 auto Iter = vp_depth_first_deep (Plan->getVectorLoopRegion ()->getEntry ());
43544353 for (VPBasicBlock *VPBB : VPBlockUtils::blocksOnly<VPBasicBlock>(Iter)) {
43554354 for (auto &R : *VPBB) {
@@ -4452,8 +4451,7 @@ void LoopVectorizationPlanner::emitInvalidCostRemarks(
44524451static bool willGenerateVectors (VPlan &Plan, ElementCount VF,
44534452 const TargetTransformInfo &TTI) {
44544453 assert (VF.isVector () && " Checking a scalar VF?" );
4455- VPTypeAnalysis TypeInfo (Plan.getCanonicalIV ()->getScalarType (),
4456- Plan.getCanonicalIV ()->getScalarType ()->getContext ());
4454+ VPTypeAnalysis TypeInfo (Plan.getCanonicalIV ()->getScalarType ());
44574455 DenseSet<VPRecipeBase *> EphemeralRecipes;
44584456 collectEphemeralRecipesForVPlan (Plan, EphemeralRecipes);
44594457 // Set of already visited types.
@@ -7267,9 +7265,7 @@ LoopVectorizationPlanner::precomputeCosts(VPlan &Plan, ElementCount VF,
72677265
72687266InstructionCost LoopVectorizationPlanner::cost (VPlan &Plan,
72697267 ElementCount VF) const {
7270- LLVMContext &LLVMCtx = OrigLoop->getHeader ()->getContext ();
7271- VPCostContext CostCtx (CM.TTI , *CM.TLI , Legal->getWidestInductionType (),
7272- LLVMCtx, CM);
7268+ VPCostContext CostCtx (CM.TTI , *CM.TLI , Legal->getWidestInductionType (), CM);
72737269 InstructionCost Cost = precomputeCosts (Plan, VF, CostCtx);
72747270
72757271 // Now compute and add the VPlan-based cost.
@@ -7388,9 +7384,7 @@ VectorizationFactor LoopVectorizationPlanner::computeBestVF() {
73887384 // simplifications not accounted for in the legacy cost model. If that's the
73897385 // case, don't trigger the assertion, as the extra simplifications may cause a
73907386 // different VF to be picked by the VPlan-based cost model.
7391- LLVMContext &LLVMCtx = OrigLoop->getHeader ()->getContext ();
7392- VPCostContext CostCtx (CM.TTI , *CM.TLI , Legal->getWidestInductionType (),
7393- LLVMCtx, CM);
7387+ VPCostContext CostCtx (CM.TTI , *CM.TLI , Legal->getWidestInductionType (), CM);
73947388 precomputeCosts (BestPlan, BestFactor.Width , CostCtx);
73957389 assert ((BestFactor.Width == LegacyVF.Width ||
73967390 planContainsAdditionalSimplifications (getPlanFor (BestFactor.Width ),
@@ -7527,8 +7521,7 @@ LoopVectorizationPlanner::executePlan(
75277521 LLVM_DEBUG (BestVPlan.dump ());
75287522
75297523 // Perform the actual loop transformation.
7530- VPTransformState State (BestVF, BestUF, LI, DT, ILV.Builder , &ILV, &BestVPlan,
7531- OrigLoop->getHeader ()->getContext ());
7524+ VPTransformState State (BestVF, BestUF, LI, DT, ILV.Builder , &ILV, &BestVPlan);
75327525
75337526 // 0. Generate SCEV-dependent code into the preheader, including TripCount,
75347527 // before making any changes to the CFG.
0 commit comments