[llvm] 823d35f - [VPlan] Use RecipeBuilder to look up member when fixing IG (NFC).
Florian Hahn via llvm-commits
llvm-commits at lists.llvm.org
Sun May 7 10:03:48 PDT 2023
Author: Florian Hahn
Date: 2023-05-07T18:02:27+01:00
New Revision: 823d35fd3b6659ed140c165bed69e575e500fa5a
URL: https://github.com/llvm/llvm-project/commit/823d35fd3b6659ed140c165bed69e575e500fa5a
DIFF: https://github.com/llvm/llvm-project/commit/823d35fd3b6659ed140c165bed69e575e500fa5a.diff
LOG: [VPlan] Use RecipeBuilder to look up member when fixing IG (NFC).
Recipes for interleave group members are recorded directly in the
RecipeBuilder. Use it directly instead of going indirectly through
VPlan's Value->VPValue mapping.
Added:
Modified:
llvm/lib/Transforms/Vectorize/LoopVectorize.cpp
Removed:
################################################################################
diff --git a/llvm/lib/Transforms/Vectorize/LoopVectorize.cpp b/llvm/lib/Transforms/Vectorize/LoopVectorize.cpp
index 660b31838319..7dcc3dacd498 100644
--- a/llvm/lib/Transforms/Vectorize/LoopVectorize.cpp
+++ b/llvm/lib/Transforms/Vectorize/LoopVectorize.cpp
@@ -9045,14 +9045,13 @@ std::optional<VPlanPtr> LoopVectorizationPlanner::tryToBuildVPlanWithVPRecipes(
unsigned J = 0;
for (unsigned i = 0; i < IG->getFactor(); ++i)
if (Instruction *Member = IG->getMember(i)) {
+ VPRecipeBase *MemberR = RecipeBuilder.getRecipe(Member);
if (!Member->getType()->isVoidTy()) {
- VPValue *OriginalV = Plan->getVPValue(Member);
- Plan->removeVPValueFor(Member);
- Plan->addVPValue(Member, VPIG->getVPValue(J));
+ VPValue *OriginalV = MemberR->getVPSingleValue();
OriginalV->replaceAllUsesWith(VPIG->getVPValue(J));
J++;
}
- RecipeBuilder.getRecipe(Member)->eraseFromParent();
+ MemberR->eraseFromParent();
}
}
More information about the llvm-commits
mailing list