Skip to content

SILOptimizer: add complexity limit in ARCCodeMotion and DeadStoreElimination #64320

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
merged 1 commit into from
Mar 14, 2023

Conversation

eeckstein
Copy link
Contributor

Add an emergency exit to avoid bad compile time problems in rare corner cases. The introduced limit is more than enough for "real world" code. Even large functions have < 100 locations. But in some corner cases - especially in generated code - we can run into quadratic complexity for large functions without that limit.

Fixes a compile time problem.
Unfortunately I don't have isolated test cases for these problems.

rdar://106516360

…ination

Add an emergency exit to avoid bad compile time problems in rare corner cases.
The introduced limit is more than enough for "real world" code. Even large functions have < 100 locations.
But in some corner cases - especially in generated code - we can run into quadratic complexity for large functions without that limit.

Fixes a compile time problem.
Unfortunately I don't have isolated test cases for these problems.

rdar://106516360
@eeckstein eeckstein requested a review from atrick March 13, 2023 17:47
@eeckstein
Copy link
Contributor Author

@swift-ci test

@eeckstein
Copy link
Contributor Author

@swift-ci benchmark

Copy link
Contributor

@atrick atrick left a comment

Choose a reason for hiding this comment

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

No objections.

Ideally, optimizations would be designed to work on regions rather than functions, or to summarize locations rather than totally giving up.

If you already did some investigation of the max locations found in the SCK, it would be nice to mention that in the commit message.

@eeckstein
Copy link
Contributor Author

@swift-ci test macos

@eeckstein eeckstein merged commit 108a6a5 into swiftlang:main Mar 14, 2023
@eeckstein eeckstein deleted the fix-compile-time-problems branch March 14, 2023 11:02
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