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

Implement initial optimizing compiler backend: project wazevo #1496

Closed
mathetake opened this issue May 31, 2023 · 3 comments · Fixed by #1869
Closed

Implement initial optimizing compiler backend: project wazevo #1496

mathetake opened this issue May 31, 2023 · 3 comments · Fixed by #1869
Assignees
Labels
enhancement New feature or request

Comments

@mathetake
Copy link
Member

mathetake commented May 31, 2023

the description here will be updated over time

This issue is the first tracking issue for our frequently requested feature: the optimizing compiler backend. For background, see #777 (comment).

The ultimate goal is to develop the optimizing compiler backend which has support for arm64 and amd64 and has an equivalent performance as the state-of-the-art compilers like wasmtime or wasmer. But that work is never-ending considering that every compiler evolves over time.

Thus, this issue exists for tracking the work around building the foundation for the never-ending iterative development of our new optimizing compiler.

Goal (to close this issue):

  1. Develops the new optimizing compiler backend packages in a way that anyone can simultaneously add optimizations and do an experiment on the backend -- this requires not only the proper abstraction but also thorough code documentation on the rationale of any non-trivial logic. Cite the research papers etc as much as possible in the code.
  2. No third-party dependency - we previously thought about re-using Wasm-compiled Cranelift and embedding it in wazero to emit machine codes, but that would be more problematic in various ways plus that it contradicts our "zero" dependency policy even if it is just a binary embedding. Therefore everything will be written entirely from scratch in Go.
  3. Passes all the Wasm V1/V2 specification test on arm64.
  4. Ensures deterministic compilation (via optional testing)
  5. Running spectests against regalloc under high register preasure (by tweaking allocatable registers), and ensure that the impl is stable regardless of the available registers
  6. Pass all the wazero tests run against the current backend and interpreter.

Non-Goal

  • amd64

Note

  • I am not planning to reuse any portion of the current single-pass compiler code, so for those easger to contribute, please fight your urge to do so until my first PoC is out (I am expecting it up within July).
  • Due to the limitation posed by go runtime, the resulting backend may not be the fastest for some cases, but in anyway no one should expect it to win all bench cases. Even after this finishes, some can find a losing case for sure.
@mathetake
Copy link
Member Author

So we call this new backend wazevo for convenience like a prefix to all related PRs etc because "new optimizing compiler" is verbose. But it's just temporarily used and we can change it later whenever we want and necessary.

@mathetake mathetake changed the title Implement initial optimizing compiler backend Implement initial optimizing compiler backend: project wazevo Jun 1, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant