Stream: cranelift

Topic: ✔ How to dump cranelift IR in wasmtime?


view this post on Zulip Yuki Nakata (Feb 21 2024 at 08:30):

Hi everyone,
I'm interested in Wasmtime's JIT and would like to read the IR it generates. I'm looking for information on how to dump the IR generated by the Cranelift JIT compiler. Do any of you know about such options or methods?

view this post on Zulip bjorn3 (Feb 21 2024 at 08:41):

You can use wasmtime compile --emit-clif /path/to/some/directory your_program.wasm.

view this post on Zulip Yuki Nakata (Feb 21 2024 at 08:53):

Thank you for your prompt reply!
Is it correct to assume that the clif generated by wasmtime compile option (AOT compilation) and the clif generated by JIT compilation are the same?

view this post on Zulip bjorn3 (Feb 21 2024 at 08:57):

Yes. In case of JIT compilation Wasmtime effectively does the same as AOT compilation, except that instead of writing the compilation output to a file, it maps it as executable in memory.

view this post on Zulip Yuki Nakata (Feb 21 2024 at 09:08):

Thanks for the explanation! My question has been answered.

view this post on Zulip Notification Bot (Feb 21 2024 at 09:08):

bjorn3 has marked this topic as resolved.


Last updated: Dec 23 2024 at 12:05 UTC