Investigate using Semi-NCA in ComputeImmediateDominators
Categories
(Core :: JavaScript Engine: JIT, task, P2)
Tracking
()
Tracking | Status | |
---|---|---|
firefox133 | --- | fixed |
People
(Reporter: jandem, Assigned: jandem)
References
Details
Attachments
(3 files)
Spinning this off from bug 1916442.
The next issue is MIR dominator-tree building. The algorithm we have doesn't scale well with large MIR graphs and I want to see if we can change that to Semi-NCA which is a more recent algorithm that's also used by LLVM.
I've reimplemented ComputeImmediateDominators using Semi-NCA and it's a large improvement: 14 seconds to 7.9 seconds for ort-wasm-simd-threaded.jsep.wasm. I also verified it produces exactly the same immediate dominators for all jit-tests and this Wasm file.
My prototype patch for this is pretty straight-forward and I've added assertions to check it computes the same information as the current algorithm for all jit-tests.
The main thing left is to clean it up and make sure it doesn't regress JS/Wasm compile times for normal-size graphs.
Updated•2 months ago
|
Assignee | ||
Comment 1•2 months ago
|
||
Assignee | ||
Comment 2•2 months ago
|
||
With this patch we run both algorithms at the same time and the Semi-NCA code asserts
the immediate dominators match.
Semi-NCA is much faster for very large graphs. For the ort-wasm-simd-threaded.jsep.wasm
Wasm module in bug 1916442, it reduces the total time spent in ComputeImmediateDominators
with --no-threads
from 7171 ms to 151 ms. The LLVM backend also uses Semi-NCA.
Assignee | ||
Comment 3•2 months ago
|
||
Assignee | ||
Comment 4•2 months ago
|
||
I'm landing the "assert same results in DEBUG builds" patch first. It doesn't affect release builds yet.
If that's green I'll land part 3 a few days later.
Comment 6•2 months ago
|
||
bugherder |
Assignee | ||
Updated•1 month ago
|
Comment 8•1 month ago
|
||
bugherder |
Description
•