Cranelift: Remove unused ABICaller::signature method (#4621)

And the `ABICallerImpl::ir_sig` field that was used to implement that
method. This removes 56 bytes from the size of `ABICallerImpl` and gives us
speed ups to compilation of about 7% on all benchmarks.

```
compilation :: nanoseconds :: benchmarks/pulldown-cmark/benchmark.wasm

  Δ = 8205119.48 ± 4069474.25 (confidence = 99%)

  main.so is 0.91x to 0.97x faster than feature.so!
  feature.so is 1.03x to 1.10x faster than main.so!

  [117729152 132258110.36 167484097] main.so
  [107486500 124052990.88 138008797] feature.so

compilation :: nanoseconds :: benchmarks/bz2/benchmark.wasm

  Δ = 4645258.32 ± 1981104.59 (confidence = 99%)

  main.so is 0.92x to 0.97x faster than feature.so!
  feature.so is 1.03x to 1.08x faster than main.so!

  [76562171 85504479.28 93116863] main.so
  [75180650 80859220.96 90591978] feature.so

compilation :: nanoseconds :: benchmarks/spidermonkey/benchmark.wasm

  Δ = 150575617.54 ± 65021102.57 (confidence = 99%)

  main.so is 0.92x to 0.97x faster than feature.so!
  feature.so is 1.03x to 1.08x faster than main.so!

  [2573089039 2843117485.10 3175982602] main.so
  [2559784932 2692541867.56 3143529008] feature.so
```
This commit is contained in:
Nick Fitzgerald
2022-08-05 09:46:46 -07:00
committed by GitHub
parent 0c2a48f682
commit 1ed7b43e62
2 changed files with 0 additions and 11 deletions

View File

@@ -191,9 +191,6 @@ pub trait ABICaller {
/// Get the number of arguments expected. /// Get the number of arguments expected.
fn num_args(&self) -> usize; fn num_args(&self) -> usize;
/// Access the (possibly legalized) signature.
fn signature(&self) -> &Signature;
/// Emit a copy of an argument value from a source register, prior to the call. /// Emit a copy of an argument value from a source register, prior to the call.
/// For large arguments with associated stack buffer, this may load the address /// For large arguments with associated stack buffer, this may load the address
/// of the buffer into the argument register, if required by the ABI. /// of the buffer into the argument register, if required by the ABI.

View File

@@ -1601,8 +1601,6 @@ impl<M: ABIMachineSpec> ABICallee for ABICalleeImpl<M> {
/// ABI object for a callsite. /// ABI object for a callsite.
pub struct ABICallerImpl<M: ABIMachineSpec> { pub struct ABICallerImpl<M: ABIMachineSpec> {
/// CLIF-level signature, possibly normalized.
ir_sig: ir::Signature,
/// The called function's signature. /// The called function's signature.
sig: ABISig, sig: ABISig,
/// All uses for the callsite, i.e., function args. /// All uses for the callsite, i.e., function args.
@@ -1645,7 +1643,6 @@ impl<M: ABIMachineSpec> ABICallerImpl<M> {
let sig = ABISig::from_func_sig::<M>(&ir_sig, flags)?; let sig = ABISig::from_func_sig::<M>(&ir_sig, flags)?;
let (uses, defs, clobbers) = sig.call_uses_defs_clobbers::<M>(); let (uses, defs, clobbers) = sig.call_uses_defs_clobbers::<M>();
Ok(ABICallerImpl { Ok(ABICallerImpl {
ir_sig,
sig, sig,
uses, uses,
defs, defs,
@@ -1671,7 +1668,6 @@ impl<M: ABIMachineSpec> ABICallerImpl<M> {
let sig = ABISig::from_func_sig::<M>(&ir_sig, flags)?; let sig = ABISig::from_func_sig::<M>(&ir_sig, flags)?;
let (uses, defs, clobbers) = sig.call_uses_defs_clobbers::<M>(); let (uses, defs, clobbers) = sig.call_uses_defs_clobbers::<M>();
Ok(ABICallerImpl { Ok(ABICallerImpl {
ir_sig,
sig, sig,
uses, uses,
defs, defs,
@@ -1703,10 +1699,6 @@ fn adjust_stack_and_nominal_sp<M: ABIMachineSpec, C: LowerCtx<I = M::I>>(
impl<M: ABIMachineSpec> ABICaller for ABICallerImpl<M> { impl<M: ABIMachineSpec> ABICaller for ABICallerImpl<M> {
type I = M::I; type I = M::I;
fn signature(&self) -> &ir::Signature {
&self.ir_sig
}
fn num_args(&self) -> usize { fn num_args(&self) -> usize {
if self.sig.stack_ret_arg.is_some() { if self.sig.stack_ret_arg.is_some() {
self.sig.args.len() - 1 self.sig.args.len() - 1