[VPlan] Add assignSlot(const VPBasicBlock *) (NFC).

Factor out utility to simplify D147964 as sugested.
This commit is contained in:
Florian Hahn 2023-05-03 19:51:09 +01:00
parent 9bb28a18d9
commit b9efffa7e9
No known key found for this signature in database
GPG Key ID: CF59919C6547A668
2 changed files with 8 additions and 3 deletions

View File

@ -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) {

View File

@ -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) {