mirror of
https://github.com/mii443/wasmer.git
synced 2025-09-03 16:09:20 +00:00
1781: Cranelift upgrade r=syrusakbary a=syrusakbary <!-- Prior to submitting a PR, review the CONTRIBUTING.md document for recommendations on how to test: https://github.com/wasmerio/wasmer/blob/master/CONTRIBUTING.md#pull-requests --> # Description Upgrade Cranelift to `0.67`. This upgrade also enables all SIMD tests (with one small exception operator that is still not fixed in Cranelift). <!-- Provide details regarding the change including motivation, links to related issues, and the context of the PR. --> Co-authored-by: Syrus <me@syrusakbary.com> Co-authored-by: Syrus Akbary <me@syrusakbary.com>
wasmer-compiler-llvm

This crate contains a compiler implementation based on the LLVM Compiler Infrastructure.
Usage
First, add this crate into your Cargo.toml
dependencies:
wasmer-compiler-llvm = "1.0.0-alpha"
And then:
use wasmer::{Store, JIT};
use wasmer_compiler_llvm::LLVM;
let compiler = LLVM::new();
// Put it into an engine and add it to the store
let store = Store::new(&JIT::new(&compiler).engine());
Note: you can find a full working example using LLVM compiler here.
When to use LLVM
We recommend using LLVM as the default compiler when running WebAssembly files on any production system, as it offers maximum peformance near to native speeds.
Requirements
The LLVM compiler requires a valid installation of LLVM in your system. It currently requires LLVM 10.
You can install LLVM easily on your Debian-like system via this command:
bash -c "$(wget -O - https://apt.llvm.org/llvm.sh)"
Or in macOS:
brew install llvm
Or via any of the pre-built binaries that LLVM offers.