[PATCH] D58444: Make MergeBlockIntoPredecessor conformant to the precondition of calling DTU.applyUpdates
Phabricator via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Thu Feb 28 08:48:43 PST 2019
This revision was automatically updated to reflect the committed changes.
Closed by commit rL355105: Make MergeBlockIntoPredecessor conformant to the precondition of calling DTU. (authored by sima, committed by ).
Changed prior to commit:
https://reviews.llvm.org/D58444?vs=187559&id=188747#toc
Repository:
rL LLVM
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D58444/new/
https://reviews.llvm.org/D58444
Files:
llvm/trunk/lib/Transforms/Utils/BasicBlockUtils.cpp
Index: llvm/trunk/lib/Transforms/Utils/BasicBlockUtils.cpp
===================================================================
--- llvm/trunk/lib/Transforms/Utils/BasicBlockUtils.cpp
+++ llvm/trunk/lib/Transforms/Utils/BasicBlockUtils.cpp
@@ -186,7 +186,9 @@
Updates.push_back({DominatorTree::Delete, PredBB, BB});
for (auto I = succ_begin(BB), E = succ_end(BB); I != E; ++I) {
Updates.push_back({DominatorTree::Delete, BB, *I});
- Updates.push_back({DominatorTree::Insert, PredBB, *I});
+ // This successor of BB may already have PredBB as a predecessor.
+ if (llvm::find(successors(PredBB), *I) == succ_end(PredBB))
+ Updates.push_back({DominatorTree::Insert, PredBB, *I});
}
}
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D58444.188747.patch
Type: text/x-patch
Size: 729 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20190228/c4447e9d/attachment.bin>
More information about the llvm-commits
mailing list