Cranelift: Late-stage redundant fill removal
Categories
(Core :: JavaScript: WebAssembly, enhancement, P2)
Tracking
()
People
(Reporter: jseward, Assigned: jseward)
References
Details
Attachments
(1 file)
1.39 KB,
patch
|
Details | Diff | Splinter Review |
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.
Assignee | ||
Comment 1•5 years ago
|
||
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%.
Assignee | ||
Comment 2•5 years ago
|
||
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 | ||
Updated•5 years ago
|
Assignee | ||
Comment 3•5 years ago
|
||
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.
Updated•5 years ago
|
Assignee | ||
Comment 4•5 years ago
|
||
Closing. This got folded into bug 1570584.
Description
•