summaryrefslogtreecommitdiff
path: root/yjit/src/backend
diff options
context:
space:
mode:
authorTakashi Kokubun <takashikkbn@gmail.com>2023-03-15 16:27:36 -0700
committerGitHub <noreply@github.com>2023-03-15 16:27:36 -0700
commit61831806030612c3a8577d88945b478262ee88f7 (patch)
tree2350f6effb4fae8dda05cdc7b97f5f945d2a3116 /yjit/src/backend
parentca10274fe34abad64dcbb20569aa5899bbf4c585 (diff)
downloadruby-61831806030612c3a8577d88945b478262ee88f7.tar.gz
YJIT: Eliminate unnecessary mov for trampolines (#7537)
Diffstat (limited to 'yjit/src/backend')
-rw-r--r--yjit/src/backend/ir.rs5
1 files changed, 4 insertions, 1 deletions
diff --git a/yjit/src/backend/ir.rs b/yjit/src/backend/ir.rs
index c2b6afd760..e27049ee33 100644
--- a/yjit/src/backend/ir.rs
+++ b/yjit/src/backend/ir.rs
@@ -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]