diff --git a/cranelift/codegen/src/ir/dfg.rs b/cranelift/codegen/src/ir/dfg.rs index f76c7a3517..50f62f8857 100644 --- a/cranelift/codegen/src/ir/dfg.rs +++ b/cranelift/codegen/src/ir/dfg.rs @@ -276,7 +276,7 @@ impl DataFlowGraph { /// Fill in the type of a value, only if currently invalid (as a placeholder). pub(crate) fn fill_in_value_type(&mut self, v: Value, ty: Type) { - debug_assert!(self.values[v].ty().is_invalid()); + debug_assert!(self.values[v].ty().is_invalid() || self.values[v].ty() == ty); self.values[v].set_type(ty); } diff --git a/cranelift/filetests/filetests/egraph/isplit.clif b/cranelift/filetests/filetests/egraph/isplit.clif index ef3d8513a8..e5cb3ea49d 100644 --- a/cranelift/filetests/filetests/egraph/isplit.clif +++ b/cranelift/filetests/filetests/egraph/isplit.clif @@ -16,3 +16,14 @@ block0(v0: i128): } ; run: %a(871558149430564685057836279141) == 2147483647 + +function %b(i128, i16) -> i16 { +block0(v0: i128, v1: i16): + v2, v3 = isplit v0 + v4 = rotr v1, v3 + v5, v6 = isplit v0 + v7 = rotr v4, v6 + return v7 +} + +; run: %b(1234, 56) == 56