llvm.org GIT mirror llvm / c9087d0
[Dominators] Don't compute DFS InOut numbers eagerly. Summary: DFS InOut numbers currently get eagerly computer upon DomTree construction. They are only needed to answer dome dominance queries and they get invalidated by updates and recalculations. Because of that, it is faster in practice to compute them lazily when they are actually needed. Clang built without this patch takes 6m 45s to boostrap on my machine, and with the patch applied 6m 38s. Reviewers: sanjoy, dberlin, chandlerc Reviewed By: dberlin Subscribers: davide, llvm-commits Differential Revision: https://reviews.llvm.org/D34296 git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@306778 91177308-0d34-0410-b5e6-96231b3b80d8 Jakub Kuderski 2 years ago
3 changed file(s) with 3 addition(s) and 3 deletion(s). Raw diff Collapse all Expand all
276276 DT.DomTreeNodes[W] = IDomNode->addChild(
277277 llvm::make_unique>(W, IDomNode));
278278 }
279
280 DT.updateDFSNumbers();
281279 }
282280
283281 void doFullDFSWalk(const DomTreeT &DT) {
11 ; RUN: opt < %s -passes='require,break-crit-edges,print' -disable-output 2>&1| FileCheck %s
22 ; PR932
33
4 ; CHECK: [3] %brtrue {1,2}
4 ; CHECK: [3] %brtrue {{{[0-9]+}},{{[0-9]+}}}
55
66 declare void @use1(i32)
77
219219 EXPECT_EQ(PostDominatedBBs.size(), 0UL);
220220
221221 // Check DFS Numbers before
222 DT->updateDFSNumbers();
222223 EXPECT_EQ(DT->getNode(BB0)->getDFSNumIn(), 0UL);
223224 EXPECT_EQ(DT->getNode(BB0)->getDFSNumOut(), 7UL);
224225 EXPECT_EQ(DT->getNode(BB1)->getDFSNumIn(), 1UL);
234235 DT->recalculate(F);
235236
236237 // Check DFS Numbers after
238 DT->updateDFSNumbers();
237239 EXPECT_EQ(DT->getNode(BB0)->getDFSNumIn(), 0UL);
238240 EXPECT_EQ(DT->getNode(BB0)->getDFSNumOut(), 9UL);
239241 EXPECT_EQ(DT->getNode(BB1)->getDFSNumIn(), 1UL);