diff --git a/include/llvm/Analysis/Dominators.h b/include/llvm/Analysis/Dominators.h index b70b23c01f4..31c19c49313 100644 --- a/include/llvm/Analysis/Dominators.h +++ b/include/llvm/Analysis/Dominators.h @@ -390,6 +390,13 @@ public: if (A == 0 || B == 0) return false; + // Compare the result of the tree walk and the dfs numbers, if expensive + // checks are enabled. +#ifdef XDEBUG + assert(!DFSInfoValid + || (dominatedBySlowTreeWalk(A, B) == B->DominatedBy(A))); +#endif + if (DFSInfoValid) return B->DominatedBy(A);