]> granicus.if.org Git - llvm/commitdiff
[IDF] Delete a redundant J-edge test
authorFangrui Song <maskray@google.com>
Thu, 7 Mar 2019 11:42:59 +0000 (11:42 +0000)
committerFangrui Song <maskray@google.com>
Thu, 7 Mar 2019 11:42:59 +0000 (11:42 +0000)
In the DJ-graph based computation of iterated dominance frontiers,
SuccNode->getIDom() == Node is one of the tests to check if (Node,Succ)
is a J-edge. If it is true, since Node is dominated by Root,

  SuccLevel = level(Node)+1 > RootLevel

which means the next test SuccLevel > RootLevel will also be true. test
the check is redundant and can be deleted as it also involves one
indirection and provides no speed-up.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@355589 91177308-0d34-0410-b5e6-96231b3b80d8

lib/Analysis/IteratedDominanceFrontier.cpp

index 307bb29db15b84ca32ecdccdc9f42134b8f09d07..89257121c6ad785f27695661218a387d69dec2db 100644 (file)
@@ -64,11 +64,6 @@ void IDFCalculator<NodeTy, IsPostDom>::calculate(
       auto DoWork = [&](BasicBlock *Succ) {
         DomTreeNode *SuccNode = DT.getNode(Succ);
 
-        // Quickly skip all CFG edges that are also dominator tree edges instead
-        // of catching them below.
-        if (SuccNode->getIDom() == Node)
-          return;
-
         const unsigned SuccLevel = SuccNode->getLevel();
         if (SuccLevel > RootLevel)
           return;