Stream: git-wasmtime

Topic: wasmtime / PR #1656 MachInst backends: sink constants to ...


view this post on Zulip Wasmtime GitHub notifications bot (May 04 2020 at 22:12):

cfallin opened PR #1656 from sink-constants to master:

We've observed that there is sometimes significant wasted work in the generated
code due to spills/reloads when constants that have been CSE'd are codegen'd
once and then used much later. Because we don't support constant
rematerialization yet (bytecodealliance/regalloc.rs#19), it seems best to clone
and sink iconst-and-friends to just before their uses; this should avoid many
spills/reloads.

Stats on bz2.wasm under wasmtime on aarch64 hardware, before and
after:

Before:

 Performance counter stats for 'target/release/wasmtime run --disable-cache /home/cfallin/wasm-tests/bz2.wasm':

       3841.058300      task-clock (msec)         #    1.996 CPUs utilized
            31,786      context-switches          #    0.008 M/sec
               503      cpu-migrations            #    0.131 K/sec
            23,709      page-faults               #    0.006 M/sec
     9,803,413,280      cycles                    #    2.552 GHz
     9,470,301,612      instructions              #    0.97  insn per cycle
   <not supported>      branches
        49,773,064      branch-misses

       1.924119736 seconds time elapsed

After:

 Performance counter stats for 'target/release/wasmtime run --disable-cache /home/cfallin/wasm-tests/bz2.wasm':

       3390.286950      task-clock (msec)         #    1.962 CPUs utilized
            16,780      context-switches          #    0.005 M/sec
               157      cpu-migrations            #    0.046 K/sec
            20,398      page-faults               #    0.006 M/sec
     8,336,868,801      cycles                    #    2.459 GHz
     7,867,825,316      instructions              #    0.94  insn per cycle
   <not supported>      branches
        44,435,002      branch-misses

       1.728082422 seconds time elapsed

Compile time, as measured by clif-util wasm, went up very slightly (1.02s ->
1.07s, but 2635M insns to 2628M insns), but this is more than offset by the
runtime decrease: total wallclock time decreased by ~10% and instruction count
by ~17%.

<!--

Please ensure that the following steps are all taken care of before submitting
the PR.

Please ensure all communication adheres to the code of conduct.
-->

view this post on Zulip Wasmtime GitHub notifications bot (May 04 2020 at 22:12):

cfallin requested bnjbvr and julian-seward1 for a review on PR #1656.

view this post on Zulip Wasmtime GitHub notifications bot (May 04 2020 at 22:12):

cfallin requested bnjbvr and julian-seward1 for a review on PR #1656.

view this post on Zulip Wasmtime GitHub notifications bot (May 19 2020 at 15:12):

cfallin closed without merge PR #1656.


Last updated: Dec 23 2024 at 12:05 UTC