Skip to content

Commit

Permalink
Move the nop lowering to ISLE, and remove the final return from lower.rs
Browse files Browse the repository at this point in the history
  • Loading branch information
elliottt committed Aug 30, 2022
1 parent 2b4b257 commit 5abab68
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 7 deletions.
6 changes: 6 additions & 0 deletions cranelift/codegen/src/isa/x64/lower.isle
Original file line number Diff line number Diff line change
Expand Up @@ -3757,3 +3757,9 @@

;; SHUFPS xmm_y, xmm_xmp, 0x88
(x64_shufps dst zeros 0x88)))

;; Rules for `nop` ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;

(rule (lower (nop))
(invalid_reg))

9 changes: 2 additions & 7 deletions cranelift/codegen/src/isa/x64/lower.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down Expand Up @@ -572,13 +573,7 @@ fn lower_insn_to_regs(
| Opcode::BrTable => {
panic!("Branch opcode reached non-branch lowering logic!");
}

Opcode::Nop => {
// Nothing.
}
}

Ok(())
}

//=============================================================================
Expand Down

0 comments on commit 5abab68

Please sign in to comment.