Skip to content

[Mem2Reg] Replaced loop with getSingleSuccessor. #40020

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged

Conversation

nate-chandler
Copy link
Contributor

Thanks to the lack of critical edges in SIL, if a block B dominated by P has a successor S which is not dominated by P, then B must have only a single successor. Used this fact to replace a loop over successors to a call to getSinglePredecessor.

Also added an assertion that, in the notation above, B is dominated by P.

Thanks to the lack of critical edges in SIL, if a block B dominated by P
has a successor S which is not dominated by P, then B must have only a
single successor.  Used this fact to replace a loop over successors to a
call to getSinglePredecessor.

Also added an assertion that, in the notation above, B is dominated by
P.
@nate-chandler nate-chandler requested a review from atrick November 2, 2021 18:53
@nate-chandler
Copy link
Contributor Author

@swift-ci please test

@nate-chandler
Copy link
Contributor Author

@swift-ci please test and merge

@swift-ci swift-ci merged commit eda0080 into swiftlang:main Nov 11, 2021
@nate-chandler nate-chandler deleted the mem2reg/leverage-lack-of-critical-edges branch November 11, 2021 20:49
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants