Closed Bug 1564772 Opened 5 years ago Closed 5 years ago

Cranelift: Late-stage redundant fill removal

Categories

(Core :: JavaScript: WebAssembly, enhancement, P2)

enhancement

Tracking

()

RESOLVED FIXED

People

(Reporter: jseward, Assigned: jseward)

References

Details

Attachments

(1 file)

Cranelift's currently generates a fill for each use of a live range that has been spilled. This generates large numbers of duplicate loads from the stack at the machine code level even within individual EBBs. A simple forward pass over each EBB can remove many of the duplicates, and convert many more near-duplicates into register-to-register copies.

The current patch is at https://github.com/CraneStation/cranelift/pull/828. This bugzilla entry serves as a place for discussion and for recording performance results.

The current patch has the following performance effects, when running on a quiet Intel Xeon at 2.6 GHz:

                         # loads
              # loads  converted    run time     run time    % of
What          removed  to copies    before, ms   after, ms   before

wasm_box2d.js    2680       1890          1740        1560     89.6
fib.js              0          1          1098        1022     93.0
wasm_lua_binary  3648       3624          8441        7338     86.9
raybench.js      1017        646          3443        3353     97.4
wasm_zlib.c.js   2188       2102          2287        2163     94.6
rust-fannkuch.js   94         42          4362        4098     93.9

In short, a performance improvement of between 2.5% and 13%.

The current (8 July) version of the patch, as at PR828, also has a bug, in
that it fails to update the environment's value field in the case where a
fill is deleted entirely. This will be fixed in subsequent versions. Fixing
it has no effect on the above perf numbers.

Assignee: nobody → jseward
Blocks: 1564789
Blocks: 1570584

Note that once https://github.com/CraneStation/cranelift/pull/828 lands,
it will be necessary to add this patch on the SpiderMonkey side in order to
keep using the wasm-via-CL pipeline. Obviously that means that we won't
need to land this patch until the in-tree CL copy is updated, but it does mean
that until then, anybody wanting to hack on SM trunk and CL trunk together
will need to apply it manually.

Priority: -- → P2

Closing. This got folded into bug 1570584.

Status: NEW → RESOLVED
Closed: 5 years ago
Resolution: --- → FIXED
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: