Cranelift: implement general select_spectre_guard fallbacks. (#5420)
When adding some optimization rules for `icmp` in the egraph infrastructure, we ended up creating a path to legal CLIF but with patterns unsupported by three of our four backends: specifically, `select_spectre_guard` with a general truthy input, rather than an `icmp`. In #5206 we discussed replacing `select_spectre_guard` with something more specific, and that could still be a long-term solution here, but doing so now would interfere with ongoing refactoring of heap access lowering, so I've opted not to do so. (In that issue I was concerned about complexity and didn't see the need but with this fuzzbug I'm starting to feel a bit differently; maybe we should remove this non-orthogonal op in the long run.) Fixes #5417.
This commit is contained in:
15
cranelift/filetests/filetests/egraph/issue-5417.clif
Normal file
15
cranelift/filetests/filetests/egraph/issue-5417.clif
Normal file
@@ -0,0 +1,15 @@
|
||||
test compile
|
||||
set opt_level=speed
|
||||
set use_egraphs=true
|
||||
target x86_64
|
||||
target aarch64
|
||||
target s390x
|
||||
target riscv64
|
||||
|
||||
function %my_fn(i16) system_v {
|
||||
block0(v0: i16):
|
||||
v1 = icmp eq v0, v0
|
||||
v2 = select_spectre_guard v1, v1, v1
|
||||
return
|
||||
}
|
||||
; run: %my_fn(6330)
|
||||
Reference in New Issue
Block a user