Lines Matching defs:DTU
57 DomTreeUpdater DTU(DT, PDT, DomTreeUpdater::UpdateStrategy::Eager);
59 ASSERT_TRUE(DTU.hasDomTree());
60 ASSERT_TRUE(DTU.hasPostDomTree());
61 ASSERT_TRUE(DTU.isEager());
62 ASSERT_FALSE(DTU.isLazy());
63 ASSERT_TRUE(DTU.getDomTree().verify());
64 ASSERT_TRUE(DTU.getPostDomTree().verify());
65 ASSERT_FALSE(DTU.hasPendingUpdates());
75 DTU.applyUpdatesPermissive(
77 ASSERT_FALSE(DTU.hasPendingUpdates());
105 EXPECT_FALSE(DTU.isBBPendingDeletion(BB3));
106 DTU.applyUpdatesPermissive(Updates);
107 ASSERT_FALSE(DTU.hasPendingUpdates());
111 DTU.applyUpdatesPermissive(
114 // DTU working with Eager UpdateStrategy does not need to flush.
120 DTU.callbackDeleteBB(BB3,
125 ASSERT_FALSE(DTU.hasPendingUpdates());
128 DTU.flush();
145 DTU.recalculate(*F);
165 // Make the DTU.
168 DomTreeUpdater DTU(DT, PDT, DomTreeUpdater::UpdateStrategy::Eager);
169 ASSERT_TRUE(DTU.hasDomTree());
170 ASSERT_TRUE(DTU.hasPostDomTree());
171 ASSERT_TRUE(DTU.isEager());
172 ASSERT_FALSE(DTU.isLazy());
187 DTU.applyUpdates({{DominatorTree::Insert, NewEntry, BB0}});
190 DTU.recalculate(*F);
200 // Update the DTU. At this point bb0 now has no predecessors but is still a
202 DTU.applyUpdates({{DominatorTree::Delete, NewEntry, BB0},
209 EXPECT_FALSE(DTU.isBBPendingDeletion(BB0));
210 DTU.deleteBB(BB0);
239 // Make the DTU.
242 DomTreeUpdater DTU(&DT, PDT, DomTreeUpdater::UpdateStrategy::Lazy);
243 ASSERT_TRUE(DTU.hasDomTree());
244 ASSERT_FALSE(DTU.hasPostDomTree());
245 ASSERT_FALSE(DTU.isEager());
246 ASSERT_TRUE(DTU.isLazy());
247 ASSERT_TRUE(DTU.getDomTree().verify());
256 DTU.applyUpdatesPermissive({{DominatorTree::Insert, BB0, BB0}});
257 ASSERT_FALSE(DTU.hasPendingDomTreeUpdates());
277 // Verify. Updates to DTU must be applied *after* all changes to the CFG
279 DTU.applyUpdatesPermissive(Updates);
280 ASSERT_TRUE(DTU.getDomTree().verify());
294 EXPECT_FALSE(DTU.isBBPendingDeletion(BB3));
295 EXPECT_FALSE(DTU.hasPendingDeletedBB());
296 DTU.deleteBB(BB3);
297 EXPECT_TRUE(DTU.isBBPendingDeletion(BB3));
298 EXPECT_TRUE(DTU.hasPendingDeletedBB());
301 DTU.recalculate(*F);
302 EXPECT_FALSE(DTU.hasPendingDeletedBB());
328 // Make the DTU.
331 DomTreeUpdater DTU(&DT, PDT, DomTreeUpdater::UpdateStrategy::Lazy);
332 ASSERT_TRUE(DTU.hasDomTree());
333 ASSERT_FALSE(DTU.hasPostDomTree());
334 ASSERT_FALSE(DTU.isEager());
335 ASSERT_TRUE(DTU.isLazy());
336 ASSERT_TRUE(DTU.getDomTree().verify());
363 // DTU are not. In the first case we must have
364 // DTU.applyUpdates({{DominatorTree::Insert, Pred1, Succ}}) while in
366 // DTU.applyUpdates({{DominatorTree::Insert, Pred1, Succ}}).
382 // applyUpdates() for DTU to detect there is no longer an edge between
385 EXPECT_FALSE(DTU.isBBPendingDeletion(BB2));
386 DTU.callbackDeleteBB(BB2, Eraser);
387 EXPECT_TRUE(DTU.isBBPendingDeletion(BB2));
391 // Queue up the DTU updates.
405 // applyUpdates() for DTU to detect there is no longer an edge between
408 EXPECT_FALSE(DTU.isBBPendingDeletion(BB1));
409 DTU.callbackDeleteBB(BB1, Eraser);
410 EXPECT_TRUE(DTU.isBBPendingDeletion(BB1));
414 // Update the DTU. In this case we don't submit {DominatorTree::Insert, BB0,
421 DTU.applyUpdatesPermissive(Updates);
423 DTU.flush();
452 // Make the DTU.
455 DomTreeUpdater DTU(&DT, &PDT, DomTreeUpdater::UpdateStrategy::Lazy);
456 ASSERT_TRUE(DTU.hasDomTree());
457 ASSERT_TRUE(DTU.hasPostDomTree());
458 ASSERT_FALSE(DTU.isEager());
459 ASSERT_TRUE(DTU.isLazy());
460 ASSERT_TRUE(DTU.getDomTree().verify());
461 ASSERT_TRUE(DTU.getPostDomTree().verify());
469 DTU.applyUpdates({{DominatorTree::Delete, BB0, BB0}});
491 // queued for deletion. Its parent is still F until DTU.flushDomTree is
498 EXPECT_FALSE(DTU.isBBPendingDeletion(BB3));
499 DTU.callbackDeleteBB(BB3, [&](BasicBlock *) { CallbackFlag = true; });
500 EXPECT_TRUE(DTU.isBBPendingDeletion(BB3));
504 // Verify. Updates to DTU must be applied *after* all changes to the CFG
506 DTU.applyUpdatesPermissive(Updates);
507 ASSERT_TRUE(DTU.getDomTree().verify());
508 ASSERT_TRUE(DTU.hasPendingUpdates());
509 ASSERT_TRUE(DTU.hasPendingPostDomTreeUpdates());
510 ASSERT_FALSE(DTU.hasPendingDomTreeUpdates());
511 ASSERT_TRUE(DTU.hasPendingDeletedBB());
512 ASSERT_TRUE(DTU.getPostDomTree().verify());
513 ASSERT_FALSE(DTU.hasPendingUpdates());
514 ASSERT_FALSE(DTU.hasPendingPostDomTreeUpdates());
515 ASSERT_FALSE(DTU.hasPendingDomTreeUpdates());
516 ASSERT_FALSE(DTU.hasPendingDeletedBB());
535 // Make the DTU.
538 DomTreeUpdater DTU(DT, PDT, DomTreeUpdater::UpdateStrategy::Lazy);
539 ASSERT_TRUE(DTU.hasDomTree());
540 ASSERT_TRUE(DTU.hasPostDomTree());
541 ASSERT_FALSE(DTU.isEager());
542 ASSERT_TRUE(DTU.isLazy());
543 ASSERT_TRUE(DTU.getDomTree().verify());
544 ASSERT_TRUE(DTU.getPostDomTree().verify());
560 DTU.applyUpdates({{DominatorTree::Insert, NewEntry, BB0}});
563 DTU.recalculate(*F);
564 ASSERT_TRUE(DTU.getDomTree().verify());
565 ASSERT_TRUE(DTU.getPostDomTree().verify());
573 // Update the DTU. At this point bb0 now has no predecessors but is still a
575 DTU.applyUpdates({{DominatorTree::Delete, NewEntry, BB0},
577 DTU.flush();
583 EXPECT_FALSE(DTU.isBBPendingDeletion(BB0));
584 DTU.deleteBB(BB0);
585 EXPECT_TRUE(DTU.isBBPendingDeletion(BB0));
589 // Perform a full recalculation of the DTU. It is not necessary here but we
592 ASSERT_TRUE(DTU.hasPendingDeletedBB());
593 DTU.recalculate(*F);
594 ASSERT_FALSE(DTU.hasPendingDeletedBB());
598 // This test focus on testing a DTU holding both trees applying multiple
627 DomTreeUpdater DTU(DT, PDT, DomTreeUpdater::UpdateStrategy::Lazy);
629 ASSERT_TRUE(DTU.hasDomTree());
630 ASSERT_TRUE(DTU.hasPostDomTree());
631 ASSERT_FALSE(DTU.isEager());
632 ASSERT_TRUE(DTU.isLazy());
633 ASSERT_TRUE(DTU.getDomTree().verify());
634 ASSERT_TRUE(DTU.getPostDomTree().verify());
635 ASSERT_FALSE(DTU.hasPendingUpdates());
664 EXPECT_FALSE(DTU.isBBPendingDeletion(BB3));
665 DTU.applyUpdates(Updates);
668 ASSERT_TRUE(DTU.getDomTree().verify());
669 ASSERT_TRUE(DTU.hasPendingPostDomTreeUpdates());
670 ASSERT_FALSE(DTU.hasPendingDomTreeUpdates());
673 DTU.deleteBB(BB3);
690 DTU.applyUpdatesPermissive(Updates);
692 ASSERT_TRUE(DTU.getPostDomTree().verify());
693 ASSERT_FALSE(DTU.hasPendingPostDomTreeUpdates());
694 ASSERT_TRUE(DTU.hasPendingDomTreeUpdates());
696 DTU.flush();
713 // Make the DTU.
714 DomTreeUpdater DTU(nullptr, nullptr, DomTreeUpdater::UpdateStrategy::Lazy);
715 ASSERT_FALSE(DTU.hasDomTree());
716 ASSERT_FALSE(DTU.hasPostDomTree());
720 DTU.deleteBB(BB0);
721 ASSERT_TRUE(DTU.hasPendingDeletedBB());
722 DTU.recalculate(*F);
723 ASSERT_FALSE(DTU.hasPendingDeletedBB());
743 // Make the DTU.
745 DomTreeUpdater DTU(&DT, nullptr, DomTreeUpdater::UpdateStrategy::Lazy);
746 ASSERT_TRUE(DTU.getDomTree().verify());
759 // Update the DTU and simulate duplicates.
760 DTU.applyUpdatesPermissive({{DominatorTree::Delete, BB0, BB1},
767 ASSERT_FALSE(DTU.hasPendingUpdates());
769 // Update the DTU. Simulate an invalid update.
770 DTU.applyUpdatesPermissive({{DominatorTree::Delete, BB0, BB1}});
771 ASSERT_FALSE(DTU.hasPendingUpdates());
777 // Update the DTU and simulate invalid updates.
778 DTU.applyUpdatesPermissive({{DominatorTree::Delete, BB0, BB1},
783 ASSERT_TRUE(DTU.hasPendingUpdates());
788 DTU.applyUpdates({{DominatorTree::Insert, BB0, BB2}});
789 ASSERT_TRUE(DTU.getDomTree().verify());
816 // Make the DTU.
818 DomTreeUpdater DTU(&DT, nullptr, DomTreeUpdater::UpdateStrategy::Lazy);
819 ASSERT_TRUE(DTU.getDomTree().verify());
829 DTU.splitCriticalEdge(BBEntry, BBFalse, SplitB);
831 ASSERT_FALSE(NewDT.compare(DTU.getDomTree()));