Address nits from #1325

This commit is contained in:
Benjamin Bouvier
2020-01-22 17:25:52 +01:00
parent cc50e65f31
commit 3125431ece
3 changed files with 28 additions and 30 deletions

View File

@@ -194,8 +194,10 @@ fn perform_repairs(pos: &mut FuncCursor, cfg: &ControlFlowGraph, mut repairs: Ve
let inst_ebb = pos.func.layout.inst_ebb(inst).expect("inst in ebb");
// Insert split values prior to the terminal branch group.
let dfg = &pos.func.dfg;
let canonical = pos.func.layout.canonical_branch_inst(dfg, inst_ebb);
let canonical = pos
.func
.layout
.canonical_branch_inst(&pos.func.dfg, inst_ebb);
if let Some(first_branch) = canonical {
pos.goto_inst(first_branch);
}

View File

@@ -0,0 +1,24 @@
test legalizer
target x86_64
function u0:0(i128, i128, i64) -> i128 system_v {
ebb0(v0: i128, v1: i128, v2: i64):
jump ebb1
ebb1:
v17 = iadd v0, v1
v20 = iadd v1, v17
jump ebb79
ebb79:
v425 = iconst.i64 0
v426 = icmp_imm eq v425, 1
brnz v426, ebb80
jump ebb85(v20, v17)
ebb80:
trap user0
ebb85(v462: i128, v874: i128):
trap user0
}

View File

@@ -1,28 +0,0 @@
test compile
target x86_64
function u0:0(i128, i128, i64) -> i128 system_v {
ebb0(v0: i128, v1: i128, v2: i64):
trap user0
ebb1:
v10 = iconst.i64 0
v11 = iconst.i64 0
v17 = iconcat v10, v11
v12 = iconst.i64 0
v13 = iconst.i64 0
v20 = iconcat v12, v13
trap user0
ebb79:
v425 = iconst.i64 0
v426 = icmp_imm eq v425, 1
brnz v426, ebb80
jump ebb85(v20, v17)
ebb80:
trap user0
ebb85(v462: i128, v874: i128):
trap user0
}