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

[NativeAOT-LLVM] Add a native WASM object writer #2643

Merged
merged 4 commits into from
Aug 3, 2024

Conversation

SingleAccretion
Copy link

This adds an object writer that directly emits WASM object files (see https://github.com/WebAssembly/tool-conventions/blob/main/Linking.md) and uses it to emit data symbols. It is anticipated that future changes will use it for code (compiler-generated helpers) as well.

We have also decided to delete the LLVM-based object writer, since doing otherwise would imply either maintaining it (duplication of effort) or letting it bitrot. It means that ILC will no longer produce all output as LLVM bitcode.

There are two motivations for this change:

  1. (Primary) [NativeAOT-LLVM] Implement managed stack traces #2404 - we need to be able to emit relocations LLVM doesn't support.
  2. (Secondary) Performance: the new object writer will, of course, skip all of the LLVM steps, which have been observed to be rather lengthy on larger projects due to some algorithmic issues in LLVM.

@yowl
Copy link
Contributor

yowl commented Aug 1, 2024

This looks great!

@SingleAccretion SingleAccretion marked this pull request as ready for review August 1, 2024 21:47
@SingleAccretion
Copy link
Author

@dotnet/nativeaot-llvm

Copy link
Contributor

@yowl yowl left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This looks good to me. I'm not familiar with the object file layout, so I'm going by the fact that as it works, it is correct. Do we have any before/after numbers for total wasm size ?

@SingleAccretion
Copy link
Author

Do we have any before/after numbers for total wasm size ?

Yes - this is a no-diff change, as expected.

@jkotas
Copy link
Member

jkotas commented Aug 3, 2024

Thank you!

@jkotas jkotas merged commit 3e66fa1 into dotnet:feature/NativeAOT-LLVM Aug 3, 2024
11 checks passed
@SingleAccretion SingleAccretion deleted the WOW branch August 4, 2024 21:52
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.

4 participants