WebAssembly / WebAssembly/binaryen

Find good inlining heuristics

Open
#815 2 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
WebAssembly
Stars
8.6k
Forks
885
Avg merge
1d 19h
Merged PRs (30d)
69

Description

We have the ability to inline, and a simple inlining pass using it. That pass inlines only methods called just once, to avoid code size issues. Even that simple rule ends up not having clear benefits in either code size or speed - examples go both ways, so the pass is off by default.

We should investigate this and find good heuristics for inlining. The opportunity here is potentially large, as we can process large compilation units efficiently (and emcc runs us on the whole codebase currently, because of that) so this would mean our inlining is LTO-like in being able to span C compilation units.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

The issue names no files, tests, or entry points; start by locating the existing inlining pass and its current single-call rule. Compare candidate heuristics against both code size and speed, using the issue's examples and compilation-unit behavior as context. Done means identifying a heuristic with clear benefits and evidence that the pass should be enabled.

Written by the indexing model from the issue text.

Assessment

Tech stack
wasm
Domain
compilers
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
20/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.