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

Florian Hahn via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Jan 19 04:08:49 PST 2023


fhahn marked an inline comment as done.
fhahn added inline comments.


================
Comment at: llvm/lib/Transforms/Vectorize/VPlanCFG.h:322
+vp_depth_first_nonrecursive(VPBlockBase *G) {
+  return depth_first(VPBlockNonRecursiveTraversalWrapper<VPBlockBase *>(G));
+}
----------------
Ayal wrote:
> 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?
Done in the committed version, also added a comment to the definition of it.


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