Skip to content

Commit 4135540

Browse files
committed
[NFC] PrunedLiveness: Permit postDomBlocks dupes.
According to the documentation, ``` It's ok if postDomBlocks has duplicates or extraneous blocks, as long as they jointly post-dominate all live blocks that aren't on dead-end paths. ``` Previously, though, duplicates resulted in trapping: each element of `postDomBlocks` is pushed into a `BasicBlockWorklist`; when the second occurrence of an element in `postDomBlocks` was encountered, `BasicBlockWorklist::push` would trigger an assertion failure. Here, `pushIfNotVisited` is called instead.
1 parent af5cd31 commit 4135540

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

lib/SIL/Utils/PrunedLiveness.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -860,7 +860,7 @@ void PrunedLiveRange<LivenessWithDefs>::computeBoundary(
860860
// Visit each post-dominating block as the starting point for a
861861
// backward CFG traversal.
862862
for (auto *block : postDomBlocks) {
863-
blockWorklist.push(block);
863+
blockWorklist.pushIfNotVisited(block);
864864
}
865865
while (auto *block = blockWorklist.pop()) {
866866
// Process each block that has not been visited and is not LiveOut.

0 commit comments

Comments
 (0)