[PATCH] D48457: [LoopUnswitch]Fix comparison for DomTree updates.
Alina Sbirlea via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Thu Jun 21 16:29:52 PDT 2018
asbirlea updated this revision to Diff 152403.
asbirlea marked 5 inline comments as done.
asbirlea added a comment.
Add assert.
Repository:
rL LLVM
https://reviews.llvm.org/D48457
Files:
lib/Transforms/Scalar/LoopUnswitch.cpp
Index: lib/Transforms/Scalar/LoopUnswitch.cpp
===================================================================
--- lib/Transforms/Scalar/LoopUnswitch.cpp
+++ lib/Transforms/Scalar/LoopUnswitch.cpp
@@ -910,6 +910,7 @@
BranchInst *OldBranch,
TerminatorInst *TI) {
assert(OldBranch->isUnconditional() && "Preheader is not split correctly");
+ assert(TrueDest != FalseDest && "Branch targets should be different");
// Insert a conditional branch on LIC to the two preheaders. The original
// code is the true version and the new code is the false version.
Value *BranchVal = LIC;
@@ -942,9 +943,9 @@
if (DT) {
// First, add both successors.
SmallVector<DominatorTree::UpdateType, 3> Updates;
- if (TrueDest != OldBranchParent)
+ if (TrueDest != OldBranchSucc)
Updates.push_back({DominatorTree::Insert, OldBranchParent, TrueDest});
- if (FalseDest != OldBranchParent)
+ if (FalseDest != OldBranchSucc)
Updates.push_back({DominatorTree::Insert, OldBranchParent, FalseDest});
// If both of the new successors are different from the old one, inform the
// DT that the edge was deleted.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D48457.152403.patch
Type: text/x-patch
Size: 1246 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20180621/aa9430d2/attachment.bin>
More information about the llvm-commits
mailing list