Improve live range building for loops
Categories
(Core :: JavaScript Engine: JIT, task, P1)
Tracking
()
| Tracking | Status | |
|---|---|---|
| firefox132 | --- | fixed |
People
(Reporter: jandem, Assigned: jandem)
References
Details
Attachments
(3 files)
VirtualRegister::addInitialRange can be slow because for loops we can call that with a range that should be inserted or merged at an arbitrary position in the list. It also has a CoalesceLimit threshold and after that point we stop trying to merge ranges.
This is done because initially MIR loop blocks were not contiguous, but they are contiguous nowadays so we can now add a live range for the whole loop at once. This also lets us simplify addInitialRange because it then only has to insert or merge ranges at the front of the list.
Updated•1 year ago
|
| Assignee | ||
Comment 1•1 year ago
|
||
For the function below we'll now move the return-block after the outer
loop also if we enter the inner loop through OSR.
function f(x) {
for (var i = 0; i < 1000; i++) {
for (var j = 0; j < 200; j++) {}
if (x) {
return 1;
}
}
}
f(false);
| Assignee | ||
Comment 2•1 year ago
|
||
Loops used to not be contiguous in the MIR graph, but this is no longer the case.
| Assignee | ||
Comment 3•1 year ago
|
||
After the previous patch, ranges are now always inserted or merged at the beginning
of the list.
Comment 5•1 year ago
|
||
| bugherder | ||
https://hg.mozilla.org/mozilla-central/rev/8a367de494ea
https://hg.mozilla.org/mozilla-central/rev/3d1153094910
https://hg.mozilla.org/mozilla-central/rev/8bc2884721f0
Comment 6•1 year ago
•
|
||
This may have lead to 3.1% imrpovement on Jetstream2-tsf-wasm-Runtime
1.9% improvement on wasm-misc-optimizing-compile . However, this improved returned to the baseline after bug 1918970
Description
•