Skip to content

Fix deserialization to avoid invoking a pass N times per function #69250

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
Oct 20, 2023

Conversation

atrick
Copy link
Contributor

@atrick atrick commented Oct 18, 2023

Deserialization is calling AccessMarkerElimination repeatedly on the same function.

The bug was introduced here:

commit 872bf40
Date: Mon Aug 13 10:24:20 2018

[sil-optimizer] Centralize how we send out serialization notifications.

Where the code that uniques the deserialization callbacks was simply removed!

As a result, this pass was being invoked a number of times equal to the number of functions in the module multiplied by the number of functions being deserialized.

Fixes rdar://117141871 (Building spends most of its time in AccessMarkerElimination)

@atrick atrick requested a review from eeckstein October 18, 2023 17:29
@atrick
Copy link
Contributor Author

atrick commented Oct 18, 2023

@swift-ci test

@atrick atrick force-pushed the fix-deserialize-access branch from 240e61d to 8b617af Compare October 18, 2023 17:29
@atrick
Copy link
Contributor Author

atrick commented Oct 18, 2023

@swift-ci test

Deserialization is calling AccessMarkerElimination repeatedly on the
same function.

The bug was introduced here:

commit 872bf40
Date:   Mon Aug 13 10:24:20 2018

    [sil-optimizer] Centralize how we send out serialization notifications.

Where the code that uniques the deserialization callbacks was simply
removed!

As a result, this pass was being invoked a number of times equal to
the number of functions in the module *multiplied* by the number of
functions being deserialized.

Fixes rdar://117141871 (Building spends most of its time in
AccessMarkerElimination)
@atrick atrick force-pushed the fix-deserialize-access branch from 8b617af to ef29250 Compare October 18, 2023 17:32
@atrick
Copy link
Contributor Author

atrick commented Oct 18, 2023

@swift-ci test

Copy link
Contributor

@eeckstein eeckstein left a comment

Choose a reason for hiding this comment

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

lgtm!

@atrick
Copy link
Contributor Author

atrick commented Oct 20, 2023

@swift-ci smoke test

@atrick atrick merged commit f1bec99 into swiftlang:main Oct 20, 2023
@atrick atrick deleted the fix-deserialize-access branch October 20, 2023 18: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