Move the nop lowering to ISLE, and remove the final return from lower.rs (#4809)

Lower nop in ISLE in the x64 backend, and remove the final Ok(()) from the lower function to assert that all cases that aren't handled in ISLE will panic.
This commit is contained in:
Trevor Elliott
2022-08-30 09:14:20 -07:00
committed by GitHub
parent 3d9d759380
commit b033aba61b
2 changed files with 8 additions and 7 deletions

View File

@@ -3758,3 +3758,9 @@
;; SHUFPS xmm_y, xmm_xmp, 0x88
(x64_shufps dst zeros 0x88)))
;; Rules for `nop` ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
(rule (lower (nop))
(invalid_reg))

View File

@@ -459,7 +459,8 @@ fn lower_insn_to_regs(
| Opcode::Isplit
| Opcode::TlsValue
| Opcode::SqmulRoundSat
| Opcode::Uunarrow => {
| Opcode::Uunarrow
| Opcode::Nop => {
let ty = if outputs.len() > 0 {
Some(ctx.output_ty(insn, 0))
} else {
@@ -572,15 +573,9 @@ fn lower_insn_to_regs(
| Opcode::BrTable => {
panic!("Branch opcode reached non-branch lowering logic!");
}
Opcode::Nop => {
// Nothing.
}
}
Ok(())
}
//=============================================================================
// Lowering-backend trait implementation.