Skip to content
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

optimizer: keep statements that may throw from being optimized by SROA #48068

Merged
merged 1 commit into from
Jan 4, 2023

Conversation

aviatesk
Copy link
Member

@aviatesk aviatesk commented Jan 1, 2023

SROA should verify a statement won't throw, otherwise it can't be eliminated safely.
Note that this commit skips the nothrow-ness verification on getfield statement. This is acceptable because currently we are unable to prove it in the presence of potentially undefined fields. This is okay because our SROA pass will eliminate such a getfield statement only if it determines that the forwarded value safely defines the potentially undefined field.

fixes #48067.

@aviatesk aviatesk requested a review from Keno January 1, 2023 12:25
base/compiler/ssair/passes.jl Outdated Show resolved Hide resolved
@aviatesk
Copy link
Member Author

aviatesk commented Jan 3, 2023

@nanosoldier runbenchmarks(!"scalar", vs=":master")

@nanosoldier
Copy link
Collaborator

Your job failed.

SROA should verify a statement won't throw, otherwise it can't be
eliminated safely.
Note that this commit skips the nothrow-ness verification on `getfield`
statement. This is acceptable because currently we are unable to prove
it in the presence of potentially undefined fields. This is okay because
our SROA pass will eliminate such a `getfield` statement only if it
determines that the forwarded value safely defines the potentially
undefined field.
@aviatesk
Copy link
Member Author

aviatesk commented Jan 4, 2023

@nanosoldier runbenchmarks(!"scalar", vs=":master")

@nanosoldier
Copy link
Collaborator

Your benchmark job has completed - possible performance regressions were detected. A full report can be found here.

@aviatesk
Copy link
Member Author

aviatesk commented Jan 4, 2023

The test failures on Windows seem not to relate to this change. Going to merge.

@aviatesk aviatesk merged commit cdcb07f into master Jan 4, 2023
@aviatesk aviatesk deleted the avi/sroa-fix branch January 4, 2023 08:54
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.

optimizer: SROA should preserve statement that may throw
3 participants