From: Fangrui Song Date: Thu, 7 Mar 2019 11:42:59 +0000 (+0000) Subject: [IDF] Delete a redundant J-edge test X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=e44e91e1f0f1952ff6f3e2e82acdf918491535de;p=llvm [IDF] Delete a redundant J-edge test 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 --- diff --git a/lib/Analysis/IteratedDominanceFrontier.cpp b/lib/Analysis/IteratedDominanceFrontier.cpp index 307bb29db15..89257121c6a 100644 --- a/lib/Analysis/IteratedDominanceFrontier.cpp +++ b/lib/Analysis/IteratedDominanceFrontier.cpp @@ -64,11 +64,6 @@ void IDFCalculator::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;