YJIT: Eliminate unnecessary mov for trampolines (#7537)

This commit is contained in:
Takashi Kokubun 2023-03-15 16:27:36 -07:00 committed by GitHub
parent ca10274fe3
commit 6183180603
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
Notes: git 2023-03-15 23:28:02 +00:00
Merged-By: k0kubun <takashikkbn@gmail.com>

View File

@ -1491,7 +1491,10 @@ impl Assembler {
}
pub fn load_into(&mut self, dest: Opnd, opnd: Opnd) {
self.push_insn(Insn::LoadInto { dest, opnd });
match (dest, opnd) {
(Opnd::Reg(dest), Opnd::Reg(opnd)) if dest == opnd => {}, // skip if noop
_ => self.push_insn(Insn::LoadInto { dest, opnd }),
}
}
#[must_use]