[llvm] b9efffa - [VPlan] Add assignSlot(const VPBasicBlock *) (NFC).
Florian Hahn via llvm-commits
llvm-commits at lists.llvm.org
Wed May 3 11:51:24 PDT 2023
Author: Florian Hahn
Date: 2023-05-03T19:51:09+01:00
New Revision: b9efffa7e9d01395ebd4ddbb7d0ecb02e017c76e
URL: https://github.com/llvm/llvm-project/commit/b9efffa7e9d01395ebd4ddbb7d0ecb02e017c76e
DIFF: https://github.com/llvm/llvm-project/commit/b9efffa7e9d01395ebd4ddbb7d0ecb02e017c76e.diff
LOG: [VPlan] Add assignSlot(const VPBasicBlock *) (NFC).
Factor out utility to simplify D147964 as sugested.
Added:
Modified:
llvm/lib/Transforms/Vectorize/VPlan.cpp
llvm/lib/Transforms/Vectorize/VPlanValue.h
Removed:
################################################################################
diff --git a/llvm/lib/Transforms/Vectorize/VPlan.cpp b/llvm/lib/Transforms/Vectorize/VPlan.cpp
index 9e8ce60d2d9bd..563421e398d05 100644
--- a/llvm/lib/Transforms/Vectorize/VPlan.cpp
+++ b/llvm/lib/Transforms/Vectorize/VPlan.cpp
@@ -1116,9 +1116,13 @@ void VPSlotTracker::assignSlots(const VPlan &Plan) {
RPOT(VPBlockDeepTraversalWrapper<const VPBlockBase *>(Plan.getEntry()));
for (const VPBasicBlock *VPBB :
VPBlockUtils::blocksOnly<const VPBasicBlock>(RPOT))
- for (const VPRecipeBase &Recipe : *VPBB)
- for (VPValue *Def : Recipe.definedValues())
- assignSlot(Def);
+ assignSlots(VPBB);
+}
+
+void VPSlotTracker::assignSlots(const VPBasicBlock *VPBB) {
+ for (const VPRecipeBase &Recipe : *VPBB)
+ for (VPValue *Def : Recipe.definedValues())
+ assignSlot(Def);
}
bool vputils::onlyFirstLaneUsed(VPValue *Def) {
diff --git a/llvm/lib/Transforms/Vectorize/VPlanValue.h b/llvm/lib/Transforms/Vectorize/VPlanValue.h
index e861553cb56e2..c1a30133a0f8d 100644
--- a/llvm/lib/Transforms/Vectorize/VPlanValue.h
+++ b/llvm/lib/Transforms/Vectorize/VPlanValue.h
@@ -440,6 +440,7 @@ class VPSlotTracker {
void assignSlot(const VPValue *V);
void assignSlots(const VPlan &Plan);
+ void assignSlots(const VPBasicBlock *VPBB);
public:
VPSlotTracker(const VPlan *Plan = nullptr) {
More information about the llvm-commits
mailing list