[PATCH] D100176: [VPlan] Use recursive traversal iterator in VPSlotTracker.
Florian Hahn via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Thu Apr 22 11:11:09 PDT 2021
fhahn added inline comments.
================
Comment at: llvm/lib/Transforms/Vectorize/VPlan.cpp:1243
+ if (!VPBB)
+ continue;
+ for (const VPRecipeBase &Recipe : *VPBB) {
----------------
a.elovikov wrote:
> I think that such usage would be the most common one (i.e. skipping the regions). Can we outline it into a separate helper somehow? The first idea coming to my mind is our custom `VPlanRPOT` class using the regular `RPOT` as a member and exposing iterators through `filter_iterator`, but maybe something nicer can be done as well.
I've put up D101093, which adds a helper to turn an iterator range into an iterator range that only includes `VPBasicBlocks` and also casts them to `VPBasicBlock` when de-referencing. It should support arbitrary iterators (RPO, depth first, post order), at the cost of having separate versions for `const VPBasicBlock *` and `VPBasicBLock *`
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D100176/new/
https://reviews.llvm.org/D100176
More information about the llvm-commits
mailing list