Skip to content

Use the new side effect analysis in the performance inliner #62000

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 7 commits into from
Nov 9, 2022

Conversation

eeckstein
Copy link
Contributor

This is the first part of replacing the old escape- and side-effect analysis. The second part is here: #61715

The inliner uses side-effect analysis to check if a function is a pure function (used for the inlining heuristics).

This PR also contains a few bug fixes for the ComputeSideEffects pass.

We can ignore any memory writes in a program termination point, because it's not relevant for the caller.
But we need to consider memory reads, otherwise preceeding memory writes would be eliminated by dead-store-elimination in the caller.
E.g. String initialization for error strings which are printed by the program termination point.
Regarding ownership: a program termination point must not touch any reference counted objects.
It was a wrong assumption that we can ignore effects in dead-end blocks.
…turn an allocated object

There are examples of such functions, which were previously captured by `isPureCall` in the inliner. But the implementation of `isPureCall` was wrong.
With the new (and correct) side effect analysis we need to correctly handle such functions in the inlining heuristic.
@eeckstein
Copy link
Contributor Author

@swift-ci test

@eeckstein
Copy link
Contributor Author

@swift-ci benchmark

@eeckstein
Copy link
Contributor Author

@swift-ci test macos

@eeckstein eeckstein merged commit a478034 into swiftlang:main Nov 9, 2022
@eeckstein eeckstein deleted the side-effects-in-inliner branch November 9, 2022 17:20
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.

1 participant