diff options
author | Chijun Sima <simachijun@gmail.com> | 2018-07-13 04:02:13 +0000 |
---|---|---|
committer | Chijun Sima <simachijun@gmail.com> | 2018-07-13 04:02:13 +0000 |
commit | bc2f48c38d36f3cc01220846a1b6fef95521cb9e (patch) | |
tree | e3e0676dfeb6181e189f06eace35322aab479bfc /unittests | |
parent | 9074a87ea5f5fc9fa96e955834a79465b59b6703 (diff) |
[DomTreeUpdater] Ignore updates when both DT and PDT are nullptrs
Summary:
Previously, when both DT and PDT are nullptrs and the UpdateStrategy is Lazy, DomTreeUpdater still pends updates inside.
After this patch, DomTreeUpdater will ignore all updates from(`applyUpdates()/insertEdge*()/deleteEdge*()`) in this case. (call `delBB()` still pends BasicBlock deletion until a flush event according to the doc).
The behavior of DomTreeUpdater previously documented won't change after the patch.
Reviewers: dmgreen, davide, kuhar, brzycki, grosser
Reviewed By: kuhar
Subscribers: llvm-commits
Differential Revision: https://reviews.llvm.org/D48974
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@336968 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'unittests')
-rw-r--r-- | unittests/IR/DomTreeUpdaterTest.cpp | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/unittests/IR/DomTreeUpdaterTest.cpp b/unittests/IR/DomTreeUpdaterTest.cpp index 10d84442617..03b6b529fd8 100644 --- a/unittests/IR/DomTreeUpdaterTest.cpp +++ b/unittests/IR/DomTreeUpdaterTest.cpp @@ -72,8 +72,8 @@ TEST(DomTreeUpdater, EagerUpdateBasicOperations) { SwitchInst *SI = dyn_cast<SwitchInst>(BB0->getTerminator()); ASSERT_NE(SI, nullptr) << "Couldn't get SwitchInst."; - ASSERT_FALSE(DTU.insertEdgeRelaxed(BB0, BB0)); - ASSERT_TRUE(DTU.deleteEdgeRelaxed(BB0, BB0)); + DTU.insertEdgeRelaxed(BB0, BB0); + DTU.deleteEdgeRelaxed(BB0, BB0); // Delete edge bb0 -> bb3 and push the update twice to verify duplicate // entries are discarded. @@ -106,9 +106,9 @@ TEST(DomTreeUpdater, EagerUpdateBasicOperations) { ASSERT_FALSE(DTU.hasPendingUpdates()); // Invalid Insert: no edge bb1 -> bb2 after change to bb0. - ASSERT_FALSE(DTU.insertEdgeRelaxed(BB1, BB2)); + DTU.insertEdgeRelaxed(BB1, BB2); // Invalid Delete: edge exists bb0 -> bb1 after change to bb0. - ASSERT_FALSE(DTU.deleteEdgeRelaxed(BB0, BB1)); + DTU.deleteEdgeRelaxed(BB0, BB1); // DTU working with Eager UpdateStrategy does not need to flush. ASSERT_TRUE(DT.verify()); @@ -183,7 +183,7 @@ TEST(DomTreeUpdater, EagerUpdateReplaceEntryBB) { EXPECT_EQ(F->begin()->getName(), NewEntry->getName()); EXPECT_TRUE(&F->getEntryBlock() == NewEntry); - ASSERT_TRUE(DTU.insertEdgeRelaxed(NewEntry, BB0)); + DTU.insertEdgeRelaxed(NewEntry, BB0); // Changing the Entry BB requires a full recalculation of DomTree. DTU.recalculate(*F); |