summaryrefslogtreecommitdiff
path: root/src/ir/module-utils.cpp
diff options
context:
space:
mode:
authorAlon Zakai <azakai@google.com>2024-08-14 10:45:01 -0700
committerGitHub <noreply@github.com>2024-08-14 10:45:01 -0700
commit39553a0247eb39c2f58c883cd6fb6b7e00f559ad (patch)
tree13a422451627b4011e2963c1b1e6304fa65421f5 /src/ir/module-utils.cpp
parent0c84afe87ea67239c4d7bf885b43b5c4f52322af (diff)
downloadbinaryen-39553a0247eb39c2f58c883cd6fb6b7e00f559ad.tar.gz
binaryen-39553a0247eb39c2f58c883cd6fb6b7e00f559ad.tar.bz2
binaryen-39553a0247eb39c2f58c883cd6fb6b7e00f559ad.zip
Monomorphization: Add a flag to control the required improvement (#6837)
The argument is the minimum benefit we must see for us to decide to optimize, e.g. --monomorphize --pass-arg=monomorphize-min-benefit@50 When the minimum benefit is 50% then if we reduce the cost by 50% through monomorphization then we optimize there. 95% would only optimize when we remove almost all the cost, etc. In practice I see 95% will actually tend to reduce code size overall, as while we add monomorphized versions of functions, we only do so when we remove a lot of work and size, and after inlining we gain benefits. However, 50% or even lower can lead to better benchmark results, in return for larger code size, just like with inlining. To be careful, the default is set to 95%. Previously we optimized whenever we saw any benefit at all, which is the same as requiring a minimum benefit of 0%. Old tests have the flag applied in this PR to set that value, so they do not change.
Diffstat (limited to 'src/ir/module-utils.cpp')
0 files changed, 0 insertions, 0 deletions