[llvm] r323058 - [Dominators] Remove misleading double-deletion test
Jakub Kuderski via llvm-commits
llvm-commits at lists.llvm.org
Sat Jan 20 19:07:17 PST 2018
Author: kuhar
Date: Sat Jan 20 19:07:16 2018
New Revision: 323058
URL: http://llvm.org/viewvc/llvm-project?rev=323058&view=rev
Log:
[Dominators] Remove misleading double-deletion test
Summary:
It's generally not safe to perform multiple DomTree updates without using the incremental API.
Although it is supposed to work in this particular case, the testcase is misleading/confusing, and it's better to remove it.
Reviewers: dberlin, brzycki, davide, grosser
Reviewed By: davide
Subscribers: llvm-commits
Differential Revision: https://reviews.llvm.org/D42333
Modified:
llvm/trunk/unittests/IR/DominatorTreeTest.cpp
Modified: llvm/trunk/unittests/IR/DominatorTreeTest.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/unittests/IR/DominatorTreeTest.cpp?rev=323058&r1=323057&r2=323058&view=diff
==============================================================================
--- llvm/trunk/unittests/IR/DominatorTreeTest.cpp (original)
+++ llvm/trunk/unittests/IR/DominatorTreeTest.cpp Sat Jan 20 19:07:16 2018
@@ -822,36 +822,6 @@ TEST(DominatorTree, DeleteUnreachable) {
}
}
-TEST(DominatorTree, DeletionsInSubtrees) {
- CFGHolder Holder;
- std::vector<CFGBuilder::Arc> Arcs = {{"0", "1"}, {"1", "2"}, {"1", "3"},
- {"1", "6"}, {"3", "4"}, {"2", "5"},
- {"5", "2"}};
-
- // It is possible to perform multiple deletions and inform the
- // DominatorTree about them at the same time, if the all of the
- // deletions happen in different subtrees.
- std::vector<CFGBuilder::Update> Updates = {{Delete, {"1", "2"}},
- {Delete, {"1", "3"}}};
- CFGBuilder B(Holder.F, Arcs, Updates);
- DominatorTree DT(*Holder.F);
- EXPECT_TRUE(DT.verify());
-
- Optional<CFGBuilder::Update> LastUpdate;
- while ((LastUpdate = B.applyUpdate()))
- ;
-
- DT.deleteEdge(B.getOrAddBlock("1"), B.getOrAddBlock("2"));
- DT.deleteEdge(B.getOrAddBlock("1"), B.getOrAddBlock("3"));
-
- EXPECT_TRUE(DT.verify());
- EXPECT_EQ(DT.getNode(B.getOrAddBlock("2")), nullptr);
- EXPECT_EQ(DT.getNode(B.getOrAddBlock("3")), nullptr);
- EXPECT_EQ(DT.getNode(B.getOrAddBlock("4")), nullptr);
- EXPECT_EQ(DT.getNode(B.getOrAddBlock("5")), nullptr);
- EXPECT_NE(DT.getNode(B.getOrAddBlock("6")), nullptr);
-}
-
TEST(DominatorTree, InsertDelete) {
std::vector<CFGBuilder::Arc> Arcs = {
{"1", "2"}, {"2", "3"}, {"3", "4"}, {"4", "5"}, {"5", "6"}, {"5", "7"},
More information about the llvm-commits
mailing list