Use a SmallVec for ABIArgSlots (#4586)
These are always length 1 for Wasm benchmarks. <h3>Sightglass Benchmark Results</h3> ``` compilation :: nanoseconds :: benchmarks/spidermonkey/benchmark.wasm Δ = 328624015.86 ± 40274677.93 (confidence = 99%) main.so is 0.88x to 0.91x faster than slots-smallvec.so! slots-smallvec.so is 1.10x to 1.13x faster than main.so! [3070752447 3203778792.55 3446269274] main.so [2503544039 2875154776.69 3197966713] slots-smallvec.so compilation :: nanoseconds :: benchmarks/pulldown-cmark/benchmark.wasm Δ = 9685705.06 ± 3221286.87 (confidence = 99%) main.so is 0.91x to 0.96x faster than slots-smallvec.so! slots-smallvec.so is 1.05x to 1.09x faster than main.so! [129356493 145594942.79 165038803] main.so [118555011 135909237.73 188780619] slots-smallvec.so compilation :: nanoseconds :: benchmarks/bz2/benchmark.wasm No difference in performance. [79080493 86757564.46 112649639] main.so [78083384 85934125.69 94992743] slots-smallvec.so ```
This commit is contained in:
@@ -212,7 +212,7 @@ impl ABIMachineSpec for AArch64MachineDeps {
|
||||
let upper_reg = xreg(next_xreg + 1);
|
||||
|
||||
ret.push(ABIArg::Slots {
|
||||
slots: vec![
|
||||
slots: smallvec![
|
||||
ABIArgSlot::Reg {
|
||||
reg: lower_reg.to_real_reg().unwrap(),
|
||||
ty: param.value_type,
|
||||
|
||||
@@ -125,7 +125,7 @@ impl ABIMachineSpec for X64ABIMachineSpec {
|
||||
);
|
||||
}
|
||||
|
||||
let mut slots = vec![];
|
||||
let mut slots = ABIArgSlotVec::new();
|
||||
for (rc, reg_ty) in rcs.iter().zip(reg_tys.iter()) {
|
||||
let intreg = *rc == RegClass::Int;
|
||||
let nextreg = if intreg {
|
||||
|
||||
Reference in New Issue
Block a user