At optimization level -O2 and above, add SeparateConstOffsetFromGEP, EarlyCSE, InstCombine and LICM to the addIRPasses phase.
These passes will also enable D139415.
samparker on Jan 17 2023, 6:00 AM.Authored by
Using wasi-sdk-19, the total code size of my suite is 7985 KB. With this patch it's reduced slightly to 7982 KB.
I don't know... I just use wasi-sdk and I assumed it just uses clang, llvm and lld.
Though, after reporting the (small) code size changes, the reported performance numbers (large) didn't make sense. I'm still investigating what's going on.
The clang driver will automatically call wasm-opt if it finds it in your PATH, so it's worth checking whether wasm-opt is being run or not.
Sorry for the delay in replying.
I found it impossible to reproduce my previously quoted numbers. I'm juggling an evolving benchmark suite, while modifying wasi-sdk and NodeJS, so I'm guessing I got something out-of-sync!
Below are my revised numbers, with the varying configuration options for completeness. I'm running on an Ampere Altra, with a modified version of NodeJS which uses trap handlers for OOB checks (the patch is currently in review for V8), and I'm only using the TurboFan compiler to reduce noise. wasm-opt is not on my PATH. The main takeaways are: