@@ -8485,14 +8485,14 @@ VPRecipeBuilder::tryToWidenMemory(Instruction *I, ArrayRef<VPValue *> Operands,
84858485 Builder.insert (VectorPtr);
84868486 Ptr = VectorPtr;
84878487 }
8488- auto Metadata = getRecipeMetadata (I);
84898488 if (LoadInst *Load = dyn_cast<LoadInst>(I))
84908489 return new VPWidenLoadRecipe (*Load, Ptr, Mask, Consecutive, Reverse,
8491- Metadata , I->getDebugLoc ());
8490+ VPIRMetadata (*Load, LVer) , I->getDebugLoc ());
84928491
84938492 StoreInst *Store = cast<StoreInst>(I);
84948493 return new VPWidenStoreRecipe (*Store, Ptr, Operands[0 ], Mask, Consecutive,
8495- Reverse, Metadata, I->getDebugLoc ());
8494+ Reverse, VPIRMetadata (*Store, LVer),
8495+ I->getDebugLoc ());
84968496}
84978497
84988498// / Creates a VPWidenIntOrFpInductionRecpipe for \p Phi. If needed, it will also
@@ -8866,7 +8866,7 @@ VPRecipeBuilder::handleReplication(Instruction *I, ArrayRef<VPValue *> Operands,
88668866 (Range.Start .isScalable () && isa<IntrinsicInst>(I))) &&
88678867 " Should not predicate a uniform recipe" );
88688868 auto *Recipe = new VPReplicateRecipe (I, Operands, IsUniform, BlockInMask,
8869- getRecipeMetadata (I ));
8869+ VPIRMetadata (*I, LVer ));
88708870 return Recipe;
88718871}
88728872
@@ -8987,20 +8987,6 @@ bool VPRecipeBuilder::getScaledReductions(
89878987 return false ;
89888988}
89898989
8990- VPIRMetadata VPRecipeBuilder::getRecipeMetadata (Instruction *I) const {
8991- SmallVector<std::pair<unsigned , MDNode *>> Metadata;
8992- ::getMetadataToPropagate (I, Metadata);
8993- if (!LVer || !isa<LoadInst, StoreInst>(I))
8994- return {};
8995-
8996- const auto &[AliasScopeMD, NoAliasMD] = LVer->getNoAliasMetadataFor (I);
8997- if (AliasScopeMD)
8998- Metadata.emplace_back (LLVMContext::MD_alias_scope, AliasScopeMD);
8999- if (NoAliasMD)
9000- Metadata.emplace_back (LLVMContext::MD_noalias, NoAliasMD);
9001- return {Metadata};
9002- }
9003-
90048990VPRecipeBase *VPRecipeBuilder::tryToCreateWidenRecipe (
90058991 Instruction *Instr, ArrayRef<VPValue *> Operands, VFRange &Range) {
90068992 // First, check for specific widening recipes that deal with inductions, Phi
@@ -9568,9 +9554,9 @@ LoopVectorizationPlanner::tryToBuildVPlanWithVPRecipes(VFRange &Range,
95689554 Legal->isInvariantAddressOfReduction (SI->getPointerOperand ())) {
95699555 // Only create recipe for the final invariant store of the reduction.
95709556 if (Legal->isInvariantStoreOfReduction (SI)) {
9571- auto *Recipe = new VPReplicateRecipe (
9572- SI, R.operands (), true /* IsUniform */ , nullptr /* Mask */ ,
9573- RecipeBuilder. getRecipeMetadata (SI ));
9557+ auto *Recipe =
9558+ new VPReplicateRecipe ( SI, R.operands (), true /* IsUniform */ ,
9559+ nullptr /* Mask */ , VPIRMetadata (*SI, LVer ));
95749560 Recipe->insertBefore (*MiddleVPBB, MBIP);
95759561 }
95769562 R.eraseFromParent ();
@@ -9752,7 +9738,7 @@ VPlanPtr LoopVectorizationPlanner::tryToBuildVPlan(VFRange &Range) {
97529738 // Collect mapping of IR header phis to header phi recipes, to be used in
97539739 // addScalarResumePhis.
97549740 VPRecipeBuilder RecipeBuilder (*Plan, OrigLoop, TLI, &TTI, Legal, CM, PSE,
9755- Builder);
9741+ Builder, nullptr );
97569742 for (auto &R : Plan->getVectorLoopRegion ()->getEntryBasicBlock ()->phis ()) {
97579743 if (isa<VPCanonicalIVPHIRecipe>(&R))
97589744 continue ;
0 commit comments