Remove fallthrough instruction

This commit is contained in:
bjorn3
2021-10-12 14:22:07 +02:00
parent 5b24e117ee
commit 1fd491dadd
9 changed files with 30 additions and 86 deletions

View File

@@ -2909,7 +2909,6 @@ fn lower_insn_to_regs<C: LowerCtx<I = Inst>>(
}
Opcode::Jump
| Opcode::Fallthrough
| Opcode::Brz
| Opcode::Brnz
| Opcode::BrIcmp
@@ -2980,7 +2979,7 @@ fn lower_branch<C: LowerCtx<I = Inst>>(
let op0 = ctx.data(branches[0]).opcode();
let op1 = ctx.data(branches[1]).opcode();
assert!(op1 == Opcode::Jump || op1 == Opcode::Fallthrough);
assert!(op1 == Opcode::Jump);
let taken = BranchTarget::Label(targets[0]);
let not_taken = BranchTarget::Label(targets[1]);
@@ -3029,11 +3028,8 @@ fn lower_branch<C: LowerCtx<I = Inst>>(
// Must be an unconditional branch or an indirect branch.
let op = ctx.data(branches[0]).opcode();
match op {
Opcode::Jump | Opcode::Fallthrough => {
Opcode::Jump => {
assert!(branches.len() == 1);
// In the Fallthrough case, the machine-independent driver
// fills in `targets[0]` with our fallthrough block, so this
// is valid for both Jump and Fallthrough.
ctx.emit(Inst::Jump {
dest: BranchTarget::Label(targets[0]),
});