compiler | version
command
- name | instruction count | time
clang++ | 6.0.1
perf stat clang++ -O3 -shared lib.cpp -o cpp-lib-full.so
- full | 331m | 147ms
perf stat clang -O3 lib.cpp -emit-llvm -S -o cpp-lib.ll
- emit | 218m | 95ms
perf stat llc -O3 -filetype=obj cpp-lib.ll -o cpp-lib.so
- llvm compile | 56m | 45ms
rustc | 1.29.0-nightly
perf stat rustc -O --crate-type=lib lib.rs -o rust-lib-full.so
- full | 549m | 200ms
perf stat rustc -O --crate-type=lib lib.rs --emit=llvm-ir -o rust-lib.ll
- emit | 411m | 145ms
perf stat llc -O3 -filetype=obj rust-lib.ll -o rust-lib.so
- llvm compile | 64m | 50ms
rustc | 1.29.0-nightly
perf stat rustc -O --crate-type=lib lib-min.rs -o rust-lib-min-full.so
- full | 248m | 105ms
perf stat rustc -O --crate-type=lib lib-min.rs --emit=llvm-ir -o rust-lib-min.ll
- emit | 231m | 90ms
perf stat llc -O3 -filetype=obj rust-lib-min.ll -o rust-lib-min.so
- llvm compile | 54m | 44ms