From c3a9c40d3f09634d1c0ed9fe789cdcf0dfaeddde Mon Sep 17 00:00:00 2001 From: Afonso Bordado Date: Fri, 22 Jul 2022 18:43:59 +0100 Subject: [PATCH] cranelift: Reduce directly from i128 to i32 in Switch --- cranelift/frontend/src/switch.rs | 10 ++-------- 1 file changed, 2 insertions(+), 8 deletions(-) diff --git a/cranelift/frontend/src/switch.rs b/cranelift/frontend/src/switch.rs index 6395ff6dc482..3de30d15767d 100644 --- a/cranelift/frontend/src/switch.rs +++ b/cranelift/frontend/src/switch.rs @@ -277,11 +277,6 @@ impl Switch { bx.switch_to_block(new_block); // Cast to i32, as br_table is not implemented for i64/i128 - let discr = if bits > 64 { - bx.ins().isplit(discr).0 - } else { - discr - }; bx.ins().ireduce(types::I32, discr) } bits if bits < 32 => bx.ins().uextend(types::I32, discr), @@ -677,9 +672,8 @@ block4: jump block5 block5: - v2, v3 = isplit.i128 v0 - v4 = ireduce.i32 v2 - br_table v4, block3, jt0" + v2 = ireduce.i32 v0 + br_table v2, block3, jt0" ); } }