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:
Chris Fallin
2022-10-21 10:24:48 -07:00
committed by GitHub
parent d9753fac2b
commit 86e77953f8
4 changed files with 21 additions and 3 deletions

View 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