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 29, 2022
1 parent 500a9f1 commit d1ada21
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 6 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))

8 changes: 2 additions & 6 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 @@ -573,12 +574,7 @@ fn lower_insn_to_regs(
panic!("Branch opcode reached non-branch lowering logic!");
}

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

Ok(())
}

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

0 comments on commit d1ada21

Please sign in to comment.