At optimization level -O2 and above, add SeparateConstOffsetFromGEP, EarlyCSE, InstCombine and LICM to the addIRPasses phase.
These passes will also enable D139415.
Paths
| Differential D141926
[WebAssembly] Add passes for GEP lowering Needs ReviewPublic Authored by samparker on Jan 17 2023, 6:00 AM.
Details
Diff Detail Event Timeline
Comment Actions
Using wasi-sdk-19, the total code size of my suite is 7985 KB. With this patch it's reduced slightly to 7982 KB. Comment Actions
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. Comment Actions 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.
Comment Actions 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:
Revision Contents
Diff 494620 llvm/lib/Target/WebAssembly/CMakeLists.txt
llvm/lib/Target/WebAssembly/WebAssemblyTargetMachine.cpp
llvm/test/CodeGen/WebAssembly/PR41149.ll
llvm/test/CodeGen/WebAssembly/address-offsets.ll
llvm/test/CodeGen/WebAssembly/atomic-fence.ll
llvm/test/CodeGen/WebAssembly/bulk-memory.ll
llvm/test/CodeGen/WebAssembly/bulk-memory64.ll
llvm/test/CodeGen/WebAssembly/cfg-stackify-dbg-skip.ll
llvm/test/CodeGen/WebAssembly/cfg-stackify.ll
llvm/test/CodeGen/WebAssembly/comparisons-f32.ll
llvm/test/CodeGen/WebAssembly/comparisons-f64.ll
llvm/test/CodeGen/WebAssembly/debugtrap.ll
llvm/test/CodeGen/WebAssembly/externref-ptrtoint.ll
llvm/test/CodeGen/WebAssembly/externref-tableget.ll
llvm/test/CodeGen/WebAssembly/externref-tableset.ll
llvm/test/CodeGen/WebAssembly/f32.ll
llvm/test/CodeGen/WebAssembly/f64.ll
llvm/test/CodeGen/WebAssembly/fast-isel-br-i1.ll
llvm/test/CodeGen/WebAssembly/fpclamptosat.ll
llvm/test/CodeGen/WebAssembly/fpclamptosat_vec.ll
llvm/test/CodeGen/WebAssembly/funcref-tableget.ll
llvm/test/CodeGen/WebAssembly/funcref-tableset.ll
llvm/test/CodeGen/WebAssembly/function-addr-offset.ll
llvm/test/CodeGen/WebAssembly/global-get-unlowerable.ll
llvm/test/CodeGen/WebAssembly/i128.ll
llvm/test/CodeGen/WebAssembly/implicit-def.ll
llvm/test/CodeGen/WebAssembly/indirect-import.ll
llvm/test/CodeGen/WebAssembly/indirectbr.ll
llvm/test/CodeGen/WebAssembly/ir-locals-stackid.ll
llvm/test/CodeGen/WebAssembly/ir-locals.ll
llvm/test/CodeGen/WebAssembly/libcalls.ll
llvm/test/CodeGen/WebAssembly/load-store-pic.ll
llvm/test/CodeGen/WebAssembly/mem-intrinsics.ll
llvm/test/CodeGen/WebAssembly/offset-fastisel.ll
llvm/test/CodeGen/WebAssembly/pr47375.ll
llvm/test/CodeGen/WebAssembly/pr59626.ll
llvm/test/CodeGen/WebAssembly/reg-stackify.ll
llvm/test/CodeGen/WebAssembly/return-int32.ll
llvm/test/CodeGen/WebAssembly/return-void.ll
llvm/test/CodeGen/WebAssembly/returned.ll
llvm/test/CodeGen/WebAssembly/select.ll
llvm/test/CodeGen/WebAssembly/simd-arith.ll
llvm/test/CodeGen/WebAssembly/simd-build-pair.ll
llvm/test/CodeGen/WebAssembly/simd-build-vector.ll
llvm/test/CodeGen/WebAssembly/simd-comparisons.ll
llvm/test/CodeGen/WebAssembly/simd-illegal-signext.ll
llvm/test/CodeGen/WebAssembly/simd-offset.ll
llvm/test/CodeGen/WebAssembly/simd.ll
llvm/test/CodeGen/WebAssembly/stack-protector.ll
llvm/test/CodeGen/WebAssembly/umulo-i64.ll
llvm/test/CodeGen/WebAssembly/userstack.ll
llvm/test/DebugInfo/WebAssembly/stackified-debug.ll
llvm/test/MC/WebAssembly/func-address.ll
llvm/test/MC/WebAssembly/stack-ptr-mclower.ll
llvm/test/MC/WebAssembly/stack-ptr.ll
llvm/test/tools/UpdateTestChecks/update_llc_test_checks/Inputs/wasm_generated_funcs.ll.generated.expected
llvm/test/tools/UpdateTestChecks/update_llc_test_checks/Inputs/wasm_generated_funcs.ll.nogenerated.expected
|
have you ever test with createSeparateConstOffsetFromGEPPass(true)