[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.

llvm-svn: 355589
This commit is contained in:
Fangrui Song 2019-03-07 11:42:59 +00:00
parent 8b5e5d6cae
commit 6d6e39d714

View 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;