Stream: git-wasmtime

Topic: wasmtime / PR #1846 Rewrite `lower_edge` to produce bette...


view this post on Zulip Wasmtime GitHub notifications bot (Jun 09 2020 at 08:40):

julian-seward1 opened PR #1846 from better-phis to master:

It's worth pointing out that self-assignments are common, and are not due to
deficiencies in CLIR optimisation. Rather, they occur whenever a loop back
edge doesn't modify all loop-carried values. This can easily happen if
the loop has multiple "early" back-edges -- "continues" in C parlance. Eg:

loop_header(a, b, c, d, e, f):
...
a_new = ...
b_new = ...
if (..) goto loop_header(a_new, b_new, c, d, e, f)

  ...
  c_new = ...
  d_new = ...
  if (..) goto loop_header(a_new, b_new, c_new, d_new, e, f)

  etc

For functions with many live values, this can dramatically reduce the number
of spill moves we throw into the register allocator.

In terms of compilation costs, this ranges from neutral for functions which
spill not at all, or minimally (joey_small, joey_med) to a 7.1% reduction in
insn count.

In terms of run costs, for one spill-heavy test (bz2 w/ custom timing harness),
instruction counts are reduced by 4.3%, data reads by 12.3% and data writes
by 18.5%. Note those last two figures include all reads and writes made by the
generated code, not just spills/reloads, so the proportional reduction in
spill/reload traffic must be greater.

<!--

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 (Jun 09 2020 at 11:24):

julian-seward1 requested cfallin for a review on PR #1846.

view this post on Zulip Wasmtime GitHub notifications bot (Jun 09 2020 at 16:55):

cfallin submitted PR Review.

view this post on Zulip Wasmtime GitHub notifications bot (Jun 09 2020 at 16:56):

cfallin merged PR #1846.


Last updated: Nov 22 2024 at 16:03 UTC