-
Notifications
You must be signed in to change notification settings - Fork 630
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
Setup compiler backend for producing wasm32 + simd executables #4019
Comments
Working towards iree-org#4019
I've started on this. I have a |
Progress on #4019. I can generate .wasm files using `iree-translate -iree-hal-target-backends=dylib-llvm-aot -iree-llvm-target-triple=wasm32-unknown-unknown -iree-llvm-keep-linker-artifacts` and can inspect the .wasm artifacts using `wasm-decompile` and the other tools from https://github.com/WebAssembly/wabt. I haven't yet been able to actually call a function from a generated .wasm file and inspect its output though, so we could be missing some configuration. This PR also includes some supporting changes in the other linker tools, mostly playing cross-platform development whack-a-mole until the code is robust enough. As one side effect, I can now use `UnixLinkerTool` from Windows, by passing `-iree-llvm-target-triple=x86_64-linux-gnu`, which discovers `C:\Program Files\LLVM\bin\ld.lld` on my system, from having that `bin\` directory on my `PATH`.
The wasm executables we can produce now are usable. Here's a prototype proving that we can call into them and read back the expected outputs using WAMR, which I'll be integrating into IREE's HAL (tracked in other issues): https://gist.github.com/ScottTodd/4d01f92c434e6caebf1bf2b180f02840. I haven't looked into simd codegen or runtime support yet, and there is still some room for tweaking flags ( |
#5079) Progress on #4019 There's still more work to do with build/test configurations and filtering, but this at least gets us to the point where IREE's LLVM AOT compiler path can generate flatbuffers suitable for a `wasm` runtime HAL to handle. I'm using these flags: * compiler: `-iree-hal-target-backends=wasm-llvm-aot -iree-llvm-target-triple=wasm32-unknown-unknown` * runtime: `--driver=wasm`
Fixes #4019 (the compiler backend is stable enough for demos and this seems to be all that is needed to enable SIMD in our codegen).
I suspect we will be able to reuse a majority of the LLVM AOT infra for producing the wasm32 binaries: it's just an LLVM target arch/format.
The WAMR examples compile with LLVM with
--target=wasm32-wasi -msimd128
. That should give us a .wasm file (vs. a .dll or .so) we can embed in a wasm flatbuffer (along with the reflection information) or reference as a file.The text was updated successfully, but these errors were encountered: