[llvm] [DomTree] Remove unnecessary domtree level check in SemiNCA (NFC) (PR #73107)

Nikita Popov via llvm-commits llvm-commits at lists.llvm.org
Wed Nov 22 08:06:01 PST 2023


================
@@ -289,11 +289,6 @@ struct SemiNCAInfo {
         assert(NodeToInfo.contains(N) &&
                "ReverseChildren should not contain unreachable predecessors");
 
-        const TreeNodePtr TN = DT.getNode(N);
-        // Skip predecessors whose level is above the subtree we are processing.
-        if (TN && TN->getLevel() < MinLevel)
-          continue;
----------------
nikic wrote:

I checked that if I replace this with an assertion, it does not fire in our test suite.

I opted not to keep the assertion, because this completely removes the dependency of runSemiNCA() on the dominator tree, which is imho cleaner.

https://github.com/llvm/llvm-project/pull/73107


More information about the llvm-commits mailing list