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

@@ -1614,26 +1614,9 @@ where
let condbr_types = [I8, I16, I32, I64, I128];
let _type = *self.u.choose(&condbr_types[..])?;
let val = builder.use_var(self.get_variable_of_type(_type)?);
match self.u.int_in_range(0..=2)? {
0 => {
builder.ins().brnz(val, left, &left_args[..]);
builder.ins().jump(right, &right_args[..]);
}
1 => {
builder.ins().brz(val, left, &left_args[..]);
builder.ins().jump(right, &right_args[..]);
}
2 => {
builder
.ins()
.brif(val, left, &left_args[..], right, &right_args[..]);
}
_ => unreachable!(),
}
builder
.ins()
.brif(val, left, &left_args[..], right, &right_args[..]);
}
BlockTerminator::BrTable(default, targets) => {
// Create jump tables on demand