Compute effects for indirect calls in GlobalEffects#8609
Open
stevenfontanella wants to merge 18 commits intomainfrom
Open
Compute effects for indirect calls in GlobalEffects#8609stevenfontanella wants to merge 18 commits intomainfrom
stevenfontanella wants to merge 18 commits intomainfrom
Conversation
b7ce0b6 to
9fcf76b
Compare
9fcf76b to
0e28a7a
Compare
0e28a7a to
83f4b3b
Compare
83f4b3b to
3a25c2e
Compare
kripken
reviewed
Apr 16, 2026
tlively
reviewed
Apr 17, 2026
kripken
reviewed
Apr 17, 2026
tlively
reviewed
Apr 17, 2026
kripken
reviewed
Apr 17, 2026
kripken
reviewed
Apr 17, 2026
kripken
reviewed
Apr 17, 2026
tlively
reviewed
Apr 18, 2026
Member
Author
|
Also added some tests exercising call_indirect. |
We don't need to walk up the supertype chain for type targets of indirect calls, we already do that for function implementations which would reach the type of the indirect call anyway
Member
Author
|
Added a test showing two different effect types being aggregated into the same function (global-effects-closed-world-simplify-locals.wast). |
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.
When running in --closed-world, compute effects for indirect calls by unioning the effects of all potential functions of that type. In --closed-world, we assume that all references originate in our module, so the only possible functions that we don't know about are imports. Previously we gave up on effects analysis for indirect calls.
Yields a very small byte count reduction in calcworker (3799354 - 3799297 = 57 bytes). Also shows no significant difference in runtime: (0.1346069 -> 0.13375045 = <1% improvement, probably within noise). We expect more benefits after we're able to share indirect call effects with other passes, since currently they're only seen one layer up for callers of functions that indirectly call functions (see the newly-added tests for examples).
Followups:
Part of #8615.