Skip to content

Compute effects for indirect calls in GlobalEffects#8609

Draft
stevenfontanella wants to merge 1 commit intoeffects-sccfrom
indirect-effects-scc
Draft

Compute effects for indirect calls in GlobalEffects#8609
stevenfontanella wants to merge 1 commit intoeffects-sccfrom
indirect-effects-scc

Conversation

@stevenfontanella
Copy link
Copy Markdown
Member

@stevenfontanella stevenfontanella commented Apr 15, 2026

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:

  • Share effect information per type with other passes besides just via Function::effects
  • Exclude functions that don't have an address (i.e. functions that aren't the target of ref.func) from effect analysis
  • Compute effects more precisely for exact + nullable/non-nullable references

Part of #8615.

@stevenfontanella stevenfontanella changed the base branch from main to effects-scc April 16, 2026 16:28
@stevenfontanella stevenfontanella force-pushed the indirect-effects-scc branch 7 times, most recently from b395eba to b7ce0b6 Compare April 16, 2026 20:52
@stevenfontanella stevenfontanella changed the title Indirect effects scc Compute effects for indirect calls in GlobalEffects Apr 16, 2026
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