@@ -7616,14 +7616,13 @@ VPWidenMemoryRecipe *VPRecipeBuilder::tryToWidenMemory(VPInstruction *VPI,
76167616 }
76177617 if (VPI->getOpcode () == Instruction::Load) {
76187618 auto *Load = cast<LoadInst>(I);
7619- return new VPWidenLoadRecipe (*Load, Ptr, Mask, Consecutive, Reverse,
7620- VPIRMetadata (*Load, LVer), I ->getDebugLoc ());
7619+ return new VPWidenLoadRecipe (*Load, Ptr, Mask, Consecutive, Reverse, *VPI,
7620+ VPI ->getDebugLoc ());
76217621 }
76227622
76237623 StoreInst *Store = cast<StoreInst>(I);
76247624 return new VPWidenStoreRecipe (*Store, Ptr, VPI->getOperand (0 ), Mask,
7625- Consecutive, Reverse,
7626- VPIRMetadata (*Store, LVer), VPI->getDebugLoc ());
7625+ Consecutive, Reverse, *VPI, VPI->getDebugLoc ());
76277626}
76287627
76297628// / Creates a VPWidenIntOrFpInductionRecipe for \p PhiR. If needed, it will
@@ -7742,7 +7741,7 @@ VPSingleDefRecipe *VPRecipeBuilder::tryToWidenCall(VPInstruction *VPI,
77427741 },
77437742 Range);
77447743 if (ShouldUseVectorIntrinsic)
7745- return new VPWidenIntrinsicRecipe (*CI, ID, Ops, CI->getType (),
7744+ return new VPWidenIntrinsicRecipe (*CI, ID, Ops, CI->getType (), *VPI,
77467745 VPI->getDebugLoc ());
77477746
77487747 Function *Variant = nullptr ;
@@ -7834,7 +7833,7 @@ VPWidenRecipe *VPRecipeBuilder::tryToWiden(VPInstruction *VPI) {
78347833 auto *SafeRHS =
78357834 Builder.createSelect (Mask, Ops[1 ], One, VPI->getDebugLoc ());
78367835 Ops[1 ] = SafeRHS;
7837- return new VPWidenRecipe (*I, Ops);
7836+ return new VPWidenRecipe (*I, Ops, *VPI, VPI-> getDebugLoc () );
78387837 }
78397838 [[fallthrough]];
78407839 }
@@ -7880,15 +7879,15 @@ VPWidenRecipe *VPRecipeBuilder::tryToWiden(VPInstruction *VPI) {
78807879 // For other binops, the legacy cost model only checks the second operand.
78817880 NewOps[1 ] = GetConstantViaSCEV (NewOps[1 ]);
78827881 }
7883- return new VPWidenRecipe (*I, NewOps);
7882+ return new VPWidenRecipe (*I, NewOps, *VPI, VPI-> getDebugLoc () );
78847883 }
78857884 case Instruction::ExtractValue: {
78867885 SmallVector<VPValue *> NewOps (VPI->operands ());
78877886 auto *EVI = cast<ExtractValueInst>(I);
78887887 assert (EVI->getNumIndices () == 1 && " Expected one extractvalue index" );
78897888 unsigned Idx = EVI->getIndices ()[0 ];
78907889 NewOps.push_back (Plan.getConstantInt (32 , Idx));
7891- return new VPWidenRecipe (*I, NewOps);
7890+ return new VPWidenRecipe (*I, NewOps, *VPI, VPI-> getDebugLoc () );
78927891 }
78937892 };
78947893}
@@ -7972,8 +7971,8 @@ VPReplicateRecipe *VPRecipeBuilder::handleReplication(VPInstruction *VPI,
79727971 assert ((Range.Start .isScalar () || !IsUniform || !IsPredicated ||
79737972 (Range.Start .isScalable () && isa<IntrinsicInst>(I))) &&
79747973 " Should not predicate a uniform recipe" );
7975- auto *Recipe = new VPReplicateRecipe (I, VPI-> operands (), IsUniform,
7976- BlockInMask, VPIRMetadata (*I, LVer) );
7974+ auto *Recipe =
7975+ new VPReplicateRecipe (I, VPI-> operands (), IsUniform, BlockInMask, *VPI );
79777976 return Recipe;
79787977}
79797978
@@ -8232,7 +8231,7 @@ VPRecipeBase *VPRecipeBuilder::tryToCreateWidenRecipe(VPSingleDefRecipe *R,
82328231 auto *CastR = cast<VPInstructionWithType>(R);
82338232 auto *CI = cast<CastInst>(Instr);
82348233 return new VPWidenCastRecipe (CI->getOpcode (), VPI->getOperand (0 ),
8235- CastR->getResultType (), *CI );
8234+ CastR->getResultType (), CI, *VPI, *VPI );
82368235 }
82378236
82388237 return tryToWiden (VPI);
@@ -8260,7 +8259,8 @@ VPRecipeBuilder::tryToCreatePartialReduction(VPInstruction *Reduction,
82608259 SmallVector<VPValue *, 2 > Ops;
82618260 Ops.push_back (Plan.getOrAddLiveIn (Zero));
82628261 Ops.push_back (BinOp);
8263- BinOp = new VPWidenRecipe (*ReductionI, Ops);
8262+ BinOp = new VPWidenRecipe (*ReductionI, Ops, VPIRMetadata (),
8263+ ReductionI->getDebugLoc ());
82648264 Builder.insert (BinOp->getDefiningRecipe ());
82658265 ReductionOpcode = Instruction::Add;
82668266 }
@@ -8293,7 +8293,7 @@ void LoopVectorizationPlanner::buildVPlansWithVPRecipes(ElementCount MinVF,
82938293 // candidates built later for specific VF ranges.
82948294 auto VPlan0 = VPlanTransforms::buildVPlan0 (
82958295 OrigLoop, *LI, Legal->getWidestInductionType (),
8296- getDebugLocFromInstOrOperands (Legal->getPrimaryInduction ()), PSE);
8296+ getDebugLocFromInstOrOperands (Legal->getPrimaryInduction ()), PSE, &LVer );
82978297
82988298 auto MaxVFTimes2 = MaxVF * 2 ;
82998299 for (ElementCount VF = MinVF; ElementCount::isKnownLT (VF, MaxVFTimes2);) {
@@ -8399,7 +8399,7 @@ VPlanPtr LoopVectorizationPlanner::tryToBuildVPlanWithVPRecipes(
83998399 // VPInstructions in the loop.
84008400 // ---------------------------------------------------------------------------
84018401 VPRecipeBuilder RecipeBuilder (*Plan, OrigLoop, TLI, &TTI, Legal, CM, PSE,
8402- Builder, BlockMaskCache, LVer );
8402+ Builder, BlockMaskCache);
84038403 // TODO: Handle partial reductions with EVL tail folding.
84048404 if (!CM.foldTailWithEVL ())
84058405 RecipeBuilder.collectScaledReductions (Range);
@@ -8444,9 +8444,9 @@ VPlanPtr LoopVectorizationPlanner::tryToBuildVPlanWithVPRecipes(
84448444 Legal->isInvariantAddressOfReduction (SI->getPointerOperand ())) {
84458445 // Only create recipe for the final invariant store of the reduction.
84468446 if (Legal->isInvariantStoreOfReduction (SI)) {
8447- auto *Recipe =
8448- new VPReplicateRecipe ( SI, R.operands (), true /* IsUniform */ ,
8449- nullptr /* Mask */ , VPIRMetadata (*SI, LVer ));
8447+ auto *Recipe = new VPReplicateRecipe (
8448+ SI, R.operands (), true /* IsUniform */ , nullptr /* Mask */ ,
8449+ *cast<VPInstruction>(SingleDef ));
84508450 Recipe->insertBefore (*MiddleVPBB, MBIP);
84518451 }
84528452 R.eraseFromParent ();
@@ -8597,7 +8597,7 @@ VPlanPtr LoopVectorizationPlanner::tryToBuildVPlan(VFRange &Range) {
85978597 // addScalarResumePhis.
85988598 DenseMap<VPBasicBlock *, VPValue *> BlockMaskCache;
85998599 VPRecipeBuilder RecipeBuilder (*Plan, OrigLoop, TLI, &TTI, Legal, CM, PSE,
8600- Builder, BlockMaskCache, nullptr /* LVer */ );
8600+ Builder, BlockMaskCache);
86018601 for (auto &R : Plan->getVectorLoopRegion ()->getEntryBasicBlock ()->phis ()) {
86028602 if (isa<VPCanonicalIVPHIRecipe>(&R))
86038603 continue ;
0 commit comments