[GC] Add a TypeRefiningGUFA pass#7433
Merged
kripken merged 20 commits intoWebAssembly:mainfrom Apr 3, 2025
Merged
Conversation
Member
Author
|
I took some more measurements on samples from Java, Dart, and Kotlin. The largest effect was a 0.2% code size improvement on Kotlin. Overall this helps every large program I've tested it on, so "cycles" certainly exist in practice, but it seems there are just a handful of them. I guess this validates our approach of focusing initially on modular independent refining passes, since while that doesn't handle cycles, it is faster and it apparently handles 99% of cases. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This variation of TypeRefining uses GUFA to determine what types to refine
struct fields to. GUFA does a (slow) whole-program analysis which can infer
things the normal pass cannot, e.g. refinements that contain cycles through
things like locals or globals.
This is mainly a proof of concept, as it is pretty slow to compute GUFA just
for this, and while I see improvements on real-world code, they are minor.
If we find that the benefits here are worth it, a larger refactoring could
do this optimization in the existing GUFA pass (which already does the
computation of the graph anyhow).