summaryrefslogtreecommitdiff
path: root/lib/Transforms/Scalar/SimpleLoopUnswitch.cpp
diff options
context:
space:
mode:
authorDimitry Andric <dim@FreeBSD.org>2018-08-02 17:32:43 +0000
committerDimitry Andric <dim@FreeBSD.org>2018-08-02 17:32:43 +0000
commitb7eb8e35e481a74962664b63dfb09483b200209a (patch)
tree1937fb4a348458ce2d02ade03ac3bb0aa18d2fcd /lib/Transforms/Scalar/SimpleLoopUnswitch.cpp
parenteb11fae6d08f479c0799db45860a98af528fa6e7 (diff)
Diffstat (limited to 'lib/Transforms/Scalar/SimpleLoopUnswitch.cpp')
-rw-r--r--lib/Transforms/Scalar/SimpleLoopUnswitch.cpp6
1 files changed, 4 insertions, 2 deletions
diff --git a/lib/Transforms/Scalar/SimpleLoopUnswitch.cpp b/lib/Transforms/Scalar/SimpleLoopUnswitch.cpp
index 34510cb40732..5834b619046b 100644
--- a/lib/Transforms/Scalar/SimpleLoopUnswitch.cpp
+++ b/lib/Transforms/Scalar/SimpleLoopUnswitch.cpp
@@ -459,9 +459,11 @@ static bool unswitchTrivialBranch(Loop &L, BranchInst &BI, DominatorTree &DT,
*ParentBB, *OldPH, FullUnswitch);
// Now we need to update the dominator tree.
- DT.insertEdge(OldPH, UnswitchedBB);
+ SmallVector<DominatorTree::UpdateType, 2> DTUpdates;
+ DTUpdates.push_back({DT.Insert, OldPH, UnswitchedBB});
if (FullUnswitch)
- DT.deleteEdge(ParentBB, UnswitchedBB);
+ DTUpdates.push_back({DT.Delete, ParentBB, LoopExitBB});
+ DT.applyUpdates(DTUpdates);
// The constant we can replace all of our invariants with inside the loop
// body. If any of the invariants have a value other than this the loop won't