[PATCH] D50675: [IDF] Teach Iterated Dominance Frontier to use a snapshot CFG based on a GraphDiff.
Alina Sbirlea via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Mon Aug 13 22:46:10 PDT 2018
asbirlea added inline comments.
================
Comment at: lib/Analysis/IteratedDominanceFrontier.cpp:93
+ for (auto Pair :
+ children<std::pair<const GraphDiff<BasicBlock *> *, NodeTy>>(
+ {GD, BB}))
----------------
kuhar wrote:
> Is it possible to instead create a helper function in GraffDiff that returns a node of appropriate type (like the pair here)?
> Something like `children(GraphDiff::make_node(GD, BB))`
I don't think that's how GraphTraits is intended to work, but your comment helped me understand that the InverseGraph bool is actually a property of the GraphDiff (just like doms), so it should be a template argument, not an argument to all methods.
I'll send a follow-up patch to the one adding GraphDiff to make that change and rebase this patch.
With that change, I can drop the if and this becomes:
`children<std::pair<const GraphDiff<BasicBlock *, IsPostDom> *, NodeTy>>({GD, BB})`
which I think is pretty clean.
Repository:
rL LLVM
https://reviews.llvm.org/D50675
More information about the llvm-commits
mailing list