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

sroa: Mark dead setfields as EFFECT_FREE #50373

Merged
merged 1 commit into from
Jun 30, 2023
Merged

sroa: Mark dead setfields as EFFECT_FREE #50373

merged 1 commit into from
Jun 30, 2023

Conversation

Keno
Copy link
Member

@Keno Keno commented Jun 30, 2023

sroa tries to delete any setfield! call for allocations that it knows it can remove. However, if it does not know that the type is correct for the allocation, it may not be able to remove the setfield!. If the type later gets improved (e.g. by irinterp), the statement becomes eligible for removal, but it currently requires another sroa pass to actually remove it.

Improve that situation my marking such a statement that is known-dead as IR_FLAG_EFFECT_FREE, so if we later also prove it nothrow, it (and the corresponding allocation) immediately become DCE-eligible.

sroa tries to delete any `setfield!` call for allocations that it
knows it can remove. However, if it does not know that the type is
correct for the allocation, it may not be able to remove the
setfield!. If the type later gets improved (e.g. by irinterp),
the statement becomes eligible for removal, but it currently requires
another sroa pass to actually remove it.

Improve that situation my marking such a statement that is known-dead
as IR_FLAG_EFFECT_FREE, so if we later also prove it nothrow, it
(and the corresponding allocation) immediately become DCE-eligible.
@oscardssmith oscardssmith added performance Must go faster compiler:optimizer Optimization passes (mostly in base/compiler/ssair/) labels Jun 30, 2023
@staticfloat staticfloat added the merge me PR is reviewed. Merge when all tests are passing label Jun 30, 2023
@Keno Keno merged commit a40dec1 into master Jun 30, 2023
@Keno Keno deleted the kf/sroaeffectfree branch June 30, 2023 21:37
@oscardssmith oscardssmith removed the merge me PR is reviewed. Merge when all tests are passing label Jul 1, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
compiler:optimizer Optimization passes (mostly in base/compiler/ssair/) performance Must go faster
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants