diff --git a/cranelift/codegen/src/isa/x64/lower.isle b/cranelift/codegen/src/isa/x64/lower.isle index 23f18a73f062..b86c2fe79214 100644 --- a/cranelift/codegen/src/isa/x64/lower.isle +++ b/cranelift/codegen/src/isa/x64/lower.isle @@ -3758,3 +3758,9 @@ ;; SHUFPS xmm_y, xmm_xmp, 0x88 (x64_shufps dst zeros 0x88))) + +;; Rules for `nop` ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + +(rule (lower (nop)) + (invalid_reg)) + diff --git a/cranelift/codegen/src/isa/x64/lower.rs b/cranelift/codegen/src/isa/x64/lower.rs index 6d1a0bec61bb..88ef7e500ce5 100644 --- a/cranelift/codegen/src/isa/x64/lower.rs +++ b/cranelift/codegen/src/isa/x64/lower.rs @@ -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,13 +573,7 @@ fn lower_insn_to_regs( | Opcode::BrTable => { panic!("Branch opcode reached non-branch lowering logic!"); } - - Opcode::Nop => { - // Nothing. - } } - - Ok(()) } //=============================================================================