Move default blocks into jump tables (#5756)

Move the default block off of the br_table instrution, and into the JumpTable that it references.
This commit is contained in:
Trevor Elliott
2023-02-10 08:53:30 -08:00
committed by GitHub
parent 49613be393
commit d99783fc91
21 changed files with 118 additions and 175 deletions

View File

@@ -220,7 +220,7 @@ impl Switch {
"Jump tables bigger than 2^32-1 are not yet supported"
);
let jt_data = JumpTableData::with_blocks(Vec::from(blocks));
let jt_data = JumpTableData::new(otherwise, Vec::from(blocks));
let jump_table = bx.create_jump_table(jt_data);
let discr = if first_index == 0 {
@@ -256,7 +256,7 @@ impl Switch {
_ => discr,
};
bx.ins().br_table(discr, otherwise, jump_table);
bx.ins().br_table(discr, jump_table);
}
/// Build the switch