Skip to content

Commit a08d4d0

Browse files
committed
[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 llvm-svn: 323058
1 parent 0d7d442 commit a08d4d0

File tree

1 file changed

+0
-30
lines changed

1 file changed

+0
-30
lines changed

llvm/unittests/IR/DominatorTreeTest.cpp

Lines changed: 0 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -822,36 +822,6 @@ TEST(DominatorTree, DeleteUnreachable) {
822822
}
823823
}
824824

825-
TEST(DominatorTree, DeletionsInSubtrees) {
826-
CFGHolder Holder;
827-
std::vector<CFGBuilder::Arc> Arcs = {{"0", "1"}, {"1", "2"}, {"1", "3"},
828-
{"1", "6"}, {"3", "4"}, {"2", "5"},
829-
{"5", "2"}};
830-
831-
// It is possible to perform multiple deletions and inform the
832-
// DominatorTree about them at the same time, if the all of the
833-
// deletions happen in different subtrees.
834-
std::vector<CFGBuilder::Update> Updates = {{Delete, {"1", "2"}},
835-
{Delete, {"1", "3"}}};
836-
CFGBuilder B(Holder.F, Arcs, Updates);
837-
DominatorTree DT(*Holder.F);
838-
EXPECT_TRUE(DT.verify());
839-
840-
Optional<CFGBuilder::Update> LastUpdate;
841-
while ((LastUpdate = B.applyUpdate()))
842-
;
843-
844-
DT.deleteEdge(B.getOrAddBlock("1"), B.getOrAddBlock("2"));
845-
DT.deleteEdge(B.getOrAddBlock("1"), B.getOrAddBlock("3"));
846-
847-
EXPECT_TRUE(DT.verify());
848-
EXPECT_EQ(DT.getNode(B.getOrAddBlock("2")), nullptr);
849-
EXPECT_EQ(DT.getNode(B.getOrAddBlock("3")), nullptr);
850-
EXPECT_EQ(DT.getNode(B.getOrAddBlock("4")), nullptr);
851-
EXPECT_EQ(DT.getNode(B.getOrAddBlock("5")), nullptr);
852-
EXPECT_NE(DT.getNode(B.getOrAddBlock("6")), nullptr);
853-
}
854-
855825
TEST(DominatorTree, InsertDelete) {
856826
std::vector<CFGBuilder::Arc> Arcs = {
857827
{"1", "2"}, {"2", "3"}, {"3", "4"}, {"4", "5"}, {"5", "6"}, {"5", "7"},

0 commit comments

Comments
 (0)