File tree Expand file tree Collapse file tree 1 file changed +9
-0
lines changed Expand file tree Collapse file tree 1 file changed +9
-0
lines changed Original file line number Diff line number Diff line change @@ -383,6 +383,15 @@ bool Rewriter::run() {
383
383
if (auto *terminator = dyn_cast<TermInst>(instruction)) {
384
384
auto successors = terminator->getParentBlock ()->getSuccessorBlocks ();
385
385
for (auto *successor : successors) {
386
+ // If a terminator is a barrier, it must not branch to a merge point.
387
+ // Doing so would require one of the following:
388
+ // - the terminator was passed a phi--which is handled by barriers.phis
389
+ // - the terminator had a result--which can't happen thanks to the lack
390
+ // of critical edges
391
+ // - the terminator was a BranchInst which was passed no arguments but
392
+ // which was nonetheless identified as a barrier--which is illegal
393
+ assert (successor->getSinglePredecessorBlock () ==
394
+ terminator->getParentBlock ());
386
395
madeChange |= createEndBorrow (&successor->front ());
387
396
}
388
397
} else {
You can’t perform that action at this time.
0 commit comments