[PATCH] D29243: Cache reverse graph edges during dominator construction to avoidhaving to look them up later.

Davide Italiano via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Sat Jan 28 19:49:56 PST 2017


davide added inline comments.


================
Comment at: include/llvm/Support/GenericDomTreeConstruction.h:206
     WInfo.Semi = WInfo.Parent;
-    typedef GraphTraits<Inverse<NodeT> > InvTraits;
-    for (typename InvTraits::ChildIteratorType CI =
-         InvTraits::child_begin(W),
-         E = InvTraits::child_end(W); CI != E; ++CI) {
-      typename InvTraits::NodeRef N = *CI;
-      if (DT.Info.count(N)) {  // Only if this predecessor is reachable!
+    for (auto *N : WInfo.ReverseChildren) {
         unsigned SemiU = DT.Info[Eval<GraphT>(DT, N, i + 1)].Semi;
----------------
Nit: I prefer the explicit type when non-obvious from the right hand side, and I just recently realized LLVM coding convention suggests this too. Anyway, this is just splitting hair, so, up to you.


https://reviews.llvm.org/D29243





More information about the llvm-commits mailing list