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

Use Names::getValidNameGivenExisting in binary reading #6793

Merged
merged 6 commits into from
Jul 31, 2024

Conversation

kripken
Copy link
Member

@kripken kripken commented Jul 30, 2024

We had a TODO to use it once Names was optimized, which it has been.

The Names version is also far faster. When building
https://github.com/JetBrains/kotlinconf-app it saves 70 seconds(!).

@kripken kripken requested a review from tlively July 30, 2024 22:51
@kripken
Copy link
Member Author

kripken commented Jul 30, 2024

This isn't NFC as there are minor observable differences in the names compared to before, but the new names should be just as good.

Added a test for collisions with the new naming scheme that prefers _ (there is now a function with the name func_1 rather than func.1, compared to the old test, which is kept).

Copy link
Member

@tlively tlively left a comment

Choose a reason for hiding this comment

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

Wow, that's a shocking improvement.

Copy link
Member

Choose a reason for hiding this comment

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

Can you add this as a lit test under lit/binary instead? Although it looks a like there is already an updated lit test, so maybe it isn't necessary to add a new test at all?

Copy link
Member Author

Choose a reason for hiding this comment

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

The tests check slightly different things, different possible name overlaps, with '.', '_', '$', so I think we need all three. I converted the non-lit ones to lit.

@kripken kripken merged commit c689781 into WebAssembly:main Jul 31, 2024
13 checks passed
@kripken kripken deleted the fast.name branch July 31, 2024 17:16
kripken added a commit to emscripten-core/emscripten that referenced this pull request Aug 1, 2024
WebAssembly/binaryen#6793 alters names of
functions, which two metadce tests turn out to be sensitive to. (It changes
the suffixes we use to deduplicate identical names.)
kripken added a commit to emscripten-core/emscripten that referenced this pull request Aug 2, 2024
This re-enables the tests and updates the outputs.

The suffixes vanish here as WebAssembly/binaryen#6793 replaces .1 with _1, and
we have code in this test to ignore such suffixes (as LLVM adds them, and we strip
hem to make the output less likely to change frequently).
@gkdn gkdn mentioned this pull request Aug 31, 2024
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