To protect your data, the CISO officer has suggested users to enable GitLab 2FA as soon as possible.

Commit 36f00920 authored by qinsoon's avatar qinsoon
Browse files

fix peephole opt

for movl %edi %edi (where two operands are actually %edi %rdi), we will
do a check, and ensure it get removed
parent fdec1e4f
...@@ -2,6 +2,7 @@ use compiler::CompilerPass; ...@@ -2,6 +2,7 @@ use compiler::CompilerPass;
use ast::ir::*; use ast::ir::*;
use vm::VM; use vm::VM;
use compiler::machine_code::CompiledFunction; use compiler::machine_code::CompiledFunction;
use compiler::backend;
use std::any::Any; use std::any::Any;
...@@ -43,10 +44,13 @@ impl PeepholeOptimization { ...@@ -43,10 +44,13 @@ impl PeepholeOptimization {
} }
}; };
if src_machine_reg == dst_machine_reg { if backend::get_color_for_precolroed(src_machine_reg)
== backend::get_color_for_precolroed(dst_machine_reg) {
trace!("Redundant! removed"); trace!("Redundant! removed");
// redundant, remove this move // redundant, remove this move
cf.mc_mut().set_inst_nop(inst); cf.mc_mut().set_inst_nop(inst);
} else {
} }
} }
} }
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment