diff --git a/llvm/lib/Transforms/Vectorize/VPlan.cpp b/llvm/lib/Transforms/Vectorize/VPlan.cpp --- a/llvm/lib/Transforms/Vectorize/VPlan.cpp +++ b/llvm/lib/Transforms/Vectorize/VPlan.cpp @@ -1250,26 +1250,6 @@ Slots[V] = NextSlot++; } -void VPSlotTracker::assignSlots(const VPBlockBase *VPBB) { - if (auto *Region = dyn_cast(VPBB)) - assignSlots(Region); - else - assignSlots(cast(VPBB)); -} - -void VPSlotTracker::assignSlots(const VPRegionBlock *Region) { - ReversePostOrderTraversal RPOT(Region->getEntry()); - for (const VPBlockBase *Block : RPOT) - assignSlots(Block); -} - -void VPSlotTracker::assignSlots(const VPBasicBlock *VPBB) { - for (const VPRecipeBase &Recipe : *VPBB) { - for (VPValue *Def : Recipe.definedValues()) - assignSlot(Def); - } -} - void VPSlotTracker::assignSlots(const VPlan &Plan) { for (const VPValue *V : Plan.VPExternalDefs) @@ -1278,7 +1258,13 @@ if (Plan.BackedgeTakenCount) assignSlot(Plan.BackedgeTakenCount); - ReversePostOrderTraversal RPOT(Plan.getEntry()); - for (const VPBlockBase *Block : RPOT) - assignSlots(Block); + ReversePostOrderTraversal< + VPBlockRecursiveTraversalWrapper> + RPOT(VPBlockRecursiveTraversalWrapper( + Plan.getEntry())); + for (const VPBasicBlock *VPBB : + VPBlockUtils::blocksOnly(RPOT)) + for (const VPRecipeBase &Recipe : *VPBB) + for (VPValue *Def : Recipe.definedValues()) + assignSlot(Def); } diff --git a/llvm/lib/Transforms/Vectorize/VPlanValue.h b/llvm/lib/Transforms/Vectorize/VPlanValue.h --- a/llvm/lib/Transforms/Vectorize/VPlanValue.h +++ b/llvm/lib/Transforms/Vectorize/VPlanValue.h @@ -372,11 +372,7 @@ DenseMap Slots; unsigned NextSlot = 0; - void assignSlots(const VPBlockBase *VPBB); - void assignSlots(const VPRegionBlock *Region); - void assignSlots(const VPBasicBlock *VPBB); void assignSlot(const VPValue *V); - void assignSlots(const VPlan &Plan); public: