This is an archive of the discontinued LLVM Phabricator instance.

[WebAssembly] Disable register coalescing at -O1
ClosedPublic

Authored by aheejin on Nov 21 2022, 12:57 PM.

Details

Summary

This disables RegisterCoalescer pass at -O1, which currently runs for
all levels except for -O0, as a part of common optimization pipeline.

RegisterCoalescer pass degrades Wasm debug info quality by a
significant margin. When I use LiveDebugValue analysis, disabling this
increases the average PC ranges covered by 15% on Emscripten core
benchmarks (52% -> 66.8%). (Our code is currently not using
LiveDebugValues analysis at the moment, and the experiment was done on
a local setting that enabled it. I'm planning to upstream it soon.)

In Emscripten core benchmarks, disabling this at -O1 causes +4.5% in
code size and +1% in the number of locals. The number of globals stays
the same. I believe this tradeoff is acceptable given that -O1 is not
usually used in production builds and is often used for debugging when
the application size is very large.

The plan is to investigate and fix what's causing the degradation in
that pass, but for now disabling it seems like a low-hanging quick fix.

Diff Detail

Event Timeline

aheejin created this revision.Nov 21 2022, 12:57 PM
Herald added a project: Restricted Project. · View Herald TranscriptNov 21 2022, 12:57 PM
Herald added subscribers: pmatos, asb, wingo and 5 others. · View Herald Transcript
aheejin requested review of this revision.Nov 21 2022, 12:57 PM
Herald added a project: Restricted Project. · View Herald TranscriptNov 21 2022, 12:57 PM
aheejin edited the summary of this revision. (Show Details)Nov 21 2022, 1:01 PM
aheejin edited the summary of this revision. (Show Details)
dschuff accepted this revision.Nov 21 2022, 1:04 PM

LGTM! nice investigation too.

This revision is now accepted and ready to land.Nov 21 2022, 1:04 PM
aheejin edited the summary of this revision. (Show Details)Nov 21 2022, 2:12 PM
aheejin edited the summary of this revision. (Show Details)Nov 21 2022, 2:14 PM
This revision was landed with ongoing or failed builds.Nov 21 2022, 2:16 PM
This revision was automatically updated to reflect the committed changes.