[PATCH] D38802: [Dominators] Remove the NCA check

Jakub Kuderski via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Fri Oct 13 20:01:05 PDT 2017


This revision was automatically updated to reflect the committed changes.
Closed by commit rL315790: [Dominators] Remove the NCA check (authored by kuhar).

Changed prior to commit:
  https://reviews.llvm.org/D38802?vs=118619&id=119008#toc

Repository:
  rL LLVM

https://reviews.llvm.org/D38802

Files:
  llvm/trunk/include/llvm/Support/GenericDomTreeConstruction.h


Index: llvm/trunk/include/llvm/Support/GenericDomTreeConstruction.h
===================================================================
--- llvm/trunk/include/llvm/Support/GenericDomTreeConstruction.h
+++ llvm/trunk/include/llvm/Support/GenericDomTreeConstruction.h
@@ -1461,40 +1461,6 @@
     return true;
   }
 
-  // Checks if for every edge From -> To in the graph
-  //     NCD(From, To) == IDom(To) or To.
-  bool verifyNCD(const DomTreeT &DT) {
-    clear();
-    doFullDFSWalk(DT, AlwaysDescend);
-
-    for (auto &BlockToInfo : NodeToInfo) {
-      auto &Info = BlockToInfo.second;
-
-      const NodePtr From = NumToNode[Info.Parent];
-      if (!From) continue;
-
-      const NodePtr To = BlockToInfo.first;
-      const TreeNodePtr ToTN = DT.getNode(To);
-      assert(ToTN);
-
-      const NodePtr NCD = DT.findNearestCommonDominator(From, To);
-      const TreeNodePtr NCDTN = DT.getNode(NCD);
-      const TreeNodePtr ToIDom = ToTN->getIDom();
-      if (NCDTN != ToTN && NCDTN != ToIDom) {
-        errs() << "NearestCommonDominator verification failed:\n\tNCD(From:"
-               << BlockNamePrinter(From) << ", To:" << BlockNamePrinter(To)
-               << ") = " << BlockNamePrinter(NCD)
-               << ",\t (should be To or IDom[To]: " << BlockNamePrinter(ToIDom)
-               << ")\n";
-        errs().flush();
-
-        return false;
-      }
-    }
-
-    return true;
-  }
-
   // The below routines verify the correctness of the dominator tree relative to
   // the CFG it's coming from.  A tree is a dominator tree iff it has two
   // properties, called the parent property and the sibling property.  Tarjan
@@ -1632,9 +1598,8 @@
 bool Verify(const DomTreeT &DT) {
   SemiNCAInfo<DomTreeT> SNCA(nullptr);
   return SNCA.verifyRoots(DT) && SNCA.verifyReachability(DT) &&
-         SNCA.VerifyLevels(DT) && SNCA.verifyNCD(DT) &&
-         SNCA.verifyParentProperty(DT) && SNCA.verifySiblingProperty(DT) &&
-         SNCA.VerifyDFSNumbers(DT);
+         SNCA.VerifyLevels(DT) && SNCA.verifyParentProperty(DT) &&
+         SNCA.verifySiblingProperty(DT) && SNCA.VerifyDFSNumbers(DT);
 }
 
 }  // namespace DomTreeBuilder


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D38802.119008.patch
Type: text/x-patch
Size: 2158 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20171014/217193b2/attachment.bin>


More information about the llvm-commits mailing list