Reduce arm64 Inst enum size
This reduces the size of the Inst enum from 112 bytes to 48 bytes. Using DHAT on a regex-rs.wasm benchmark, `valgrind --tool=dhat clif-util compile --target aarch64` The total number of allocated bytes, drops by around 170 MB. At t-gmax drops by 3 MB. Using `perf stat clif-util compile --target aarch64`, the instructions count dropped by 0.6%. Cache misses dropped by 6%. Cycles dropped by 2.3%.
This commit is contained in:
@@ -68,6 +68,7 @@ use crate::isa::aarch64::{self, inst::*};
|
||||
use crate::machinst::*;
|
||||
use crate::settings;
|
||||
|
||||
use alloc::boxed::Box;
|
||||
use alloc::vec::Vec;
|
||||
|
||||
use regalloc::{RealReg, Reg, RegClass, Set, SpillSlot, Writable};
|
||||
@@ -1275,9 +1276,9 @@ impl ABICall for AArch64ABICall {
|
||||
);
|
||||
match &self.dest {
|
||||
&CallDest::ExtName(ref name, RelocDistance::Near) => ctx.emit(Inst::Call {
|
||||
dest: name.clone(),
|
||||
uses,
|
||||
defs,
|
||||
dest: Box::new(name.clone()),
|
||||
uses: Box::new(uses),
|
||||
defs: Box::new(defs),
|
||||
loc: self.loc,
|
||||
opcode: self.opcode,
|
||||
}),
|
||||
@@ -1290,16 +1291,16 @@ impl ABICall for AArch64ABICall {
|
||||
});
|
||||
ctx.emit(Inst::CallInd {
|
||||
rn: spilltmp_reg(),
|
||||
uses,
|
||||
defs,
|
||||
uses: Box::new(uses),
|
||||
defs: Box::new(defs),
|
||||
loc: self.loc,
|
||||
opcode: self.opcode,
|
||||
});
|
||||
}
|
||||
&CallDest::Reg(reg) => ctx.emit(Inst::CallInd {
|
||||
rn: reg,
|
||||
uses,
|
||||
defs,
|
||||
uses: Box::new(uses),
|
||||
defs: Box::new(defs),
|
||||
loc: self.loc,
|
||||
opcode: self.opcode,
|
||||
}),
|
||||
|
||||
Reference in New Issue
Block a user