summaryrefslogtreecommitdiffstats
path: root/llvm/unittests/IR/DominatorTreeTest.cpp
diff options
context:
space:
mode:
authorJakub Kuderski <kubakuderski@gmail.com>2017-06-30 01:28:21 +0000
committerJakub Kuderski <kubakuderski@gmail.com>2017-06-30 01:28:21 +0000
commit837755cf8b859664caa848632087d175f9d67c8d (patch)
tree4ef94a82a09461739ab12113d48a5d13b666f747 /llvm/unittests/IR/DominatorTreeTest.cpp
parentbc02ef17ca3a39e67f812a34daee2cb3310ee5da (diff)
downloadbcm5719-llvm-837755cf8b859664caa848632087d175f9d67c8d.tar.gz
bcm5719-llvm-837755cf8b859664caa848632087d175f9d67c8d.zip
[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
Diffstat (limited to 'llvm/unittests/IR/DominatorTreeTest.cpp')
-rw-r--r--llvm/unittests/IR/DominatorTreeTest.cpp2
1 files changed, 2 insertions, 0 deletions
diff --git a/llvm/unittests/IR/DominatorTreeTest.cpp b/llvm/unittests/IR/DominatorTreeTest.cpp
index 232f0cbd4ed..5d3ef30177a 100644
--- a/llvm/unittests/IR/DominatorTreeTest.cpp
+++ b/llvm/unittests/IR/DominatorTreeTest.cpp
@@ -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);
OpenPOWER on IntegriCloud