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:
@@ -523,7 +523,7 @@ impl ValueDataPacked {
|
||||
|
||||
#[inline(always)]
|
||||
fn set_type(&mut self, ty: Type) {
|
||||
self.0 &= !((1 << Self::TYPE_BITS) - 1) << Self::TYPE_SHIFT;
|
||||
self.0 &= !(((1 << Self::TYPE_BITS) - 1) << Self::TYPE_SHIFT);
|
||||
self.0 |= (ty.repr() as u64) << Self::TYPE_SHIFT;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -114,7 +114,7 @@
|
||||
|
||||
;;;; Rules for `isplit` ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
||||
|
||||
(rule (lower (has_type $I64 (isplit x)))
|
||||
(rule (lower (isplit x @ (value_type $I128)))
|
||||
(let
|
||||
((x_regs ValueRegs x)
|
||||
(x_lo ValueRegs (value_regs_get x_regs 0))
|
||||
|
||||
@@ -60,7 +60,7 @@
|
||||
|
||||
;;;; Rules for `isplit` ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
||||
|
||||
(rule (lower (has_type (gpr64_ty ty) (isplit x)))
|
||||
(rule (lower (isplit x @ (value_type $I128)))
|
||||
(let ((x_reg Reg x)
|
||||
(x_hi Reg (vec_extract_lane $I64X2 x_reg 0 (zero_reg)))
|
||||
(x_lo Reg (vec_extract_lane $I64X2 x_reg 1 (zero_reg))))
|
||||
|
||||
Reference in New Issue
Block a user