[WebAssembly] Enable loop unrolling
authorSam Parker <sam.parker@arm.com>
Wed, 10 Feb 2021 08:22:45 +0000 (08:22 +0000)
committerSam Parker <sam.parker@arm.com>
Wed, 10 Feb 2021 08:25:46 +0000 (08:25 +0000)
commit9d81ccc02ffb154cd5ee7ade21740dc4a45f4261
tree21dee180fefb0ad5c18651aec6029f7fa8cd305a
parent7eee8585859c8fa5826483fb7ff30a077fc1a57f
[WebAssembly] Enable loop unrolling

Enable partial and runtime unrolling with a threshold of 30, which
was derived from a large number of kernels running on node and
wasmtime for amd64 and aarch64.

Unrolling is enabled by default at -O2 and -O3 and is disabled at
-Oz and -Os. Compiling with -Os is recommended if the wasm binary
size is the most important factor.

Differential Revision: https://reviews.llvm.org/D95125
llvm/lib/Target/WebAssembly/WebAssemblyTargetTransformInfo.cpp
llvm/lib/Target/WebAssembly/WebAssemblyTargetTransformInfo.h
llvm/test/Transforms/LoopUnroll/WebAssembly/basic-unrolling.ll [new file with mode: 0644]
llvm/test/Transforms/LoopUnroll/WebAssembly/lit.local.cfg [new file with mode: 0644]