[PATCH] D140512: [VPlan] Add vp_depth_first_shallow + graph traits for wrapper(NFC)

Ayal Zaks via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Jan 19 00:22:45 PST 2023


Ayal added inline comments.


================
Comment at: llvm/lib/Transforms/Vectorize/VPlanCFG.h:322
+vp_depth_first_nonrecursive(VPBlockBase *G) {
+  return depth_first(VPBlockNonRecursiveTraversalWrapper<VPBlockBase *>(G));
+}
----------------
fhahn wrote:
> Ayal wrote:
> > nit: for completeness can also introduce `vp_depth_first_recursive(VPBlockBase *G)` which returns `depth_first(VPBlockRecursiveTraversalWrapper<VPBlockBase *>(G));` used elsewhere.
> > 
> > nit: "recursive" here stands for traversing inside regions of the hierarchical CFG. Perhaps a more accurate term is "deep" versus "flat" or "shallow", given the recursive nature of DFS itself.
> > nit: for completeness can also introduce vp_depth_first_recursive(VPBlockBase *G) which returns depth_first(VPBlockRecursiveTraversalWrapper<VPBlockBase *>(G)); used elsewhere.
> 
> I'll add a separate patch for that.
> 
> > nit: "recursive" here stands for traversing inside regions of the hierarchical CFG. Perhaps a more accurate term is "deep" versus "flat" or "shallow", given the recursive nature of DFS itself.
> 
> Updated the name to use `_shallow` instead of non recursive, thanks!
Very good! Worth also renaming `VPBlockNonRecursiveTraversalWrapper` as `VPBlockShallowTraversalWrapper` to be consistent?


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D140512/new/

https://reviews.llvm.org/D140512



More information about the llvm-commits mailing list