cranelift: Remove brz and brnz (#5630)

Remove the brz and brnz instructions, as their behavior is now redundant with brif.
This commit is contained in:
Trevor Elliott
2023-01-30 12:34:56 -08:00
committed by GitHub
parent 77cf547f41
commit a5698cedf8
247 changed files with 2947 additions and 3754 deletions

View File

@@ -49,8 +49,7 @@ function %average(i32, i32) -> f32 system_v {
block1(v0: i32, v1: i32):
v2 = f64const 0x0.0
stack_store v2, ss0
brz v1, block5 ; Handle count == 0.
jump block2
brif v1, block2, block5 ; Handle count == 0.
block2:
v3 = iconst.i32 0
@@ -66,8 +65,7 @@ block3(v4: i32):
stack_store v10, ss0
v11 = iadd_imm v4, 1
v12 = icmp ult v11, v1
brnz v12, block3(v11) ; Loop backedge.
jump block4
brif v12, block3(v11), block4 ; Loop backedge.
block4:
v13 = stack_load.f64 ss0
@@ -414,8 +412,7 @@ function %gcd(i32 uext, i32 uext) -> i32 uext system_v {
fn0 = %divmod(i32 uext, i32 uext) -> i32 uext, i32 uext
block1(v0: i32, v1: i32):
brz v1, block3
jump block2
brif v1, block2, block3
block2:
v2, v3 = call fn0(v0, v1)