NEW 237841
[JSC] Eliminate dead bytecode locals
https://bugs.webkit.org/show_bug.cgi?id=237841
Summary [JSC] Eliminate dead bytecode locals
Robin Morisset
Reported 2022-03-14 10:42:09 PDT
The bytecode generator tends to allocate more locals than strictly necessary. I saw quite a few examples, e.g. allocating two locals for the scope even when the function is simple enough to only need one: [ 0] enter [ 1] get_scope dst:loc4 [ 3] mov dst:loc5, src:loc4 [ 6] check_traps Where loc5 is completely unused afterwards I can think of two ways to solve this: - either going carefully through a bunch of examples and for each one finding all dead locals, tracking where it came from and fixing this particular part of the bytecode generator - or just adding a generic dead local elimination phase to the bytecode generator. The latter seems easier, but the former is less likely to cause a perf regression. The memory benefit here should be tiny, but I would expect some significant win in DFG compilation time, considering that most DFG phases constantly manipulate mappings from Local -> some kind of data, and materialize these mappings at each BasicBlock boundary.
Attachments
Radar WebKit Bug Importer
Comment 1 2022-03-21 10:43:16 PDT
Note You need to log in before you can comment on or make changes to this bug.