Skip to content

[SILOptimizer]: slow OSSA lifetime canonicalization mitigation #82313

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

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

jamieQ
Copy link
Contributor

@jamieQ jamieQ commented Jun 17, 2025

OSSA lifetime canonicalization can take a very long time in certain cases in which there are large basic blocks. to mitigate this, add logic to skip walking the liveness boundary for extending liveness to dead ends when there aren't any dead ends in the function.

resolves: #82317

@jamieQ
Copy link
Contributor Author

jamieQ commented Jun 17, 2025

@swift-ci please smoke test

@jamieQ
Copy link
Contributor Author

jamieQ commented Jun 17, 2025

@swift-ci please test compiler performance

@jamieQ
Copy link
Contributor Author

jamieQ commented Jun 17, 2025

@swift-ci Please smoke test compiler performance

1 similar comment
@jamieQ
Copy link
Contributor Author

jamieQ commented Jun 17, 2025

@swift-ci Please smoke test compiler performance

Copy link
Contributor

@nate-chandler nate-chandler left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you for taking a stab at this @jamieQ ! I added a few comments.

Copy link
Contributor

@nate-chandler nate-chandler left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

OSSA lifetime canonicalization can take a very long time in certain
cases in which there are large basic blocks. to mitigate this, add logic
to skip walking the liveness boundary for extending liveness to dead
ends when there aren't any dead ends in the function.

Updates `DeadEndBlocks` with a new `isEmpty` method and cache to
determine if there are any dead-end blocks in a given function.
@jamieQ jamieQ force-pushed the copy-prop-ossa-dead-ends-build-time-fix branch from f675cc7 to 1f3f830 Compare June 18, 2025 22:52
@jamieQ
Copy link
Contributor Author

jamieQ commented Jun 18, 2025

@swift-ci please smoke test

@jamieQ jamieQ marked this pull request as ready for review June 18, 2025 22:53
@jamieQ
Copy link
Contributor Author

jamieQ commented Jun 18, 2025

@swift-ci Please smoke test compiler performance

Copy link
Contributor

@nate-chandler nate-chandler left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This looks great. Thank you, @jamieQ !

@nate-chandler
Copy link
Contributor

When you're ready, @jamieQ, please merge this and cherry-pick it to release/6.2 .

@jamieQ
Copy link
Contributor Author

jamieQ commented Jun 19, 2025

When you're ready, @jamieQ, please merge this and cherry-pick it to release/6.2 .

@nate-chandler happy to get the 6.2 release PR going, but i'll need your (or someone's) help in merging as i do not have commit access. the Linux tests appear to have failed for unrelated reasons, but i'll retry them once more.

@jamieQ
Copy link
Contributor Author

jamieQ commented Jun 19, 2025

@swift-ci Please smoke test Linux platform

@jamieQ
Copy link
Contributor Author

jamieQ commented Jun 19, 2025

@swift-ci Please clean smoke test Linux platform

@jamieQ
Copy link
Contributor Author

jamieQ commented Jun 19, 2025

@swift-ci Please smoke test Linux platform

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.

Poor scaling with optimized builds involving OSSA & copy propagation in the 6.2 compiler
2 participants