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 | 00712cb749b47ef1e1c71b06958101743f8f3408 (patch) | |
| tree | c02bcc136c1df95d9d470ea1422164dbd40fb5d6 /llvm/unittests/IR | |
| parent | dc5ba317b1c15355560fc3bf42d02f5ef3e9cf3b (diff) | |
| download | bcm5719-llvm-00712cb749b47ef1e1c71b06958101743f8f3408.tar.gz bcm5719-llvm-00712cb749b47ef1e1c71b06958101743f8f3408.zip | |
[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
llvm-svn: 336968
Diffstat (limited to 'llvm/unittests/IR')
| -rw-r--r-- | llvm/unittests/IR/DomTreeUpdaterTest.cpp | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/llvm/unittests/IR/DomTreeUpdaterTest.cpp b/llvm/unittests/IR/DomTreeUpdaterTest.cpp index 10d84442617..03b6b529fd8 100644 --- a/llvm/unittests/IR/DomTreeUpdaterTest.cpp +++ b/llvm/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); |

