Fix some egraph-related issues. (#5088)
This fixes #5086 by addressing two separate issues: - The `ValueDataPacked::set_type()` helper had an embarrassing bitfield-manipulation bug that would mangle the rest of a `ValueDef` when setting its type. This is not normally used, only when the egraph elaboration fills in types after-the-fact on a multi-value node. - The lowering rules for `isplit` on aarch64 and s390x were dispatching on the first output type, rather than the input type. When only the second output is used (as in the example in #5086), the first output type actually remains `INVALID` (and this is fine because it's never used).
This commit is contained in:
18
cranelift/filetests/filetests/egraph/isplit.clif
Normal file
18
cranelift/filetests/filetests/egraph/isplit.clif
Normal file
@@ -0,0 +1,18 @@
|
||||
test interpret
|
||||
test run
|
||||
set opt_level=speed_and_size
|
||||
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
|
||||
Reference in New Issue
Block a user