mirror of
https://github.com/RPCS3/llvm-mirror.git
synced 2025-01-31 12:41:49 +01:00
[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 llvm-svn: 306778
This commit is contained in:
parent
1e0ffcd548
commit
04daad837a
@ -277,8 +277,6 @@ struct SemiNCAInfo {
|
||||
DT.DomTreeNodes[W] = IDomNode->addChild(
|
||||
llvm::make_unique<DomTreeNodeBase<NodeT>>(W, IDomNode));
|
||||
}
|
||||
|
||||
DT.updateDFSNumbers();
|
||||
}
|
||||
|
||||
void doFullDFSWalk(const DomTreeT &DT) {
|
||||
|
@ -2,7 +2,7 @@
|
||||
; RUN: opt < %s -passes='require<domtree>,break-crit-edges,print<domtree>' -disable-output 2>&1| FileCheck %s
|
||||
; PR932
|
||||
|
||||
; CHECK: [3] %brtrue {1,2}
|
||||
; CHECK: [3] %brtrue {{{[0-9]+}},{{[0-9]+}}}
|
||||
|
||||
declare void @use1(i32)
|
||||
|
||||
|
@ -220,6 +220,7 @@ TEST(DominatorTree, Unreachable) {
|
||||
EXPECT_EQ(PostDominatedBBs.size(), 0UL);
|
||||
|
||||
// Check DFS Numbers before
|
||||
DT->updateDFSNumbers();
|
||||
EXPECT_EQ(DT->getNode(BB0)->getDFSNumIn(), 0UL);
|
||||
EXPECT_EQ(DT->getNode(BB0)->getDFSNumOut(), 7UL);
|
||||
EXPECT_EQ(DT->getNode(BB1)->getDFSNumIn(), 1UL);
|
||||
@ -235,6 +236,7 @@ TEST(DominatorTree, Unreachable) {
|
||||
DT->recalculate(F);
|
||||
|
||||
// Check DFS Numbers after
|
||||
DT->updateDFSNumbers();
|
||||
EXPECT_EQ(DT->getNode(BB0)->getDFSNumIn(), 0UL);
|
||||
EXPECT_EQ(DT->getNode(BB0)->getDFSNumOut(), 9UL);
|
||||
EXPECT_EQ(DT->getNode(BB1)->getDFSNumIn(), 1UL);
|
||||
|
Loading…
x
Reference in New Issue
Block a user