Files
wasmtime/cranelift/filetests/filetests/egraph/isplit.clif
Chris Fallin 1faff8c2ce Enable egraph-based optimization by default. (#5587)
This PR follows up on #5382 and #5391, which rebuilt the egraph-based optimization framework to be more performant, by enabling it by default.

Based on performance results in #5382 (my measurements on SpiderMonkey and bjorn3's independent confirmation with cg_clif), it seems that this is reasonable to enable. Now that we have been fuzzing compiler configurations with egraph opts (#5388) for 6 weeks, having fixed a few fuzzbugs that came up (#5409, #5420, #5438) and subsequently received no further reports from OSS-Fuzz, I believe it is stable enough to rely on.

This PR enables `use_egraphs`, and also normalizes its meaning: previously it forced optimization (it basically meant "turn on the egraph optimization machinery"), now it runs egraph opts if the opt level indicates (it means "use egraphs to optimize if we are going to optimize"). The conditionals in the top-level pass driver are a little subtle, but will get simpler once we can remove the non-egraph path (which we plan to do eventually!).

Fixes #5181.
2023-01-19 15:46:53 -08:00

30 lines
512 B
Plaintext

test interpret
test run
set opt_level=speed
set use_egraphs=true
set enable_llvm_abi_extensions=true
target x86_64
target aarch64
target s390x
function %a(i128) -> i32 {
block0(v0: i128):
v1 = iconst.i32 -1
v2, v3 = isplit v0
v4 = ushr v1, v3
return v4
}
; run: %a(871558149430564685057836279141) == 2147483647
function %b(i128, i16) -> i16 {
block0(v0: i128, v1: i16):
v2, v3 = isplit v0
v4 = rotr v1, v3
v5, v6 = isplit v0
v7 = rotr v4, v6
return v7
}
; run: %b(1234, 56) == 56