Files
wasmtime/cranelift/filetests/filetests/egraph/issue-5405.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

17 lines
285 B
Plaintext

test interpret
test run
set opt_level=speed
set use_egraphs=true
target aarch64
function %a(i64) -> i8 system_v {
block0(v0: i64):
v6 = iconst.i8 51
v17 = imul v6, v6 ; v6 = 51, v6 = 51
v18 = icmp eq v17, v17
v52 = imul v18, v18
return v52
}
; run: %a(129) == 1