aboutsummaryrefslogtreecommitdiff
path: root/llvm/lib/CodeGen/MachineFunction.cpp
diff options
context:
space:
mode:
authorPhilipp Krones <philipp.krones@embecosm.com>2021-07-14 12:21:40 +0100
committerSimon Cook <simon.cook@embecosm.com>2021-07-26 12:07:49 +0100
commit46c03668774c27877bd96957931fafae24383e3f (patch)
treee22ea5e686cb8ee518cd05fd15cee4a7c3b16299 /llvm/lib/CodeGen/MachineFunction.cpp
parentd995d63767624a60a5d3276f9f16d7b995435af1 (diff)
downloadllvm-46c03668774c27877bd96957931fafae24383e3f.zip
llvm-46c03668774c27877bd96957931fafae24383e3f.tar.gz
llvm-46c03668774c27877bd96957931fafae24383e3f.tar.bz2
[Inliner] Make the CallPenalty configurable
Tests with multiple benchmarks, like Embench [1], showed that the CallPenalty magic number has the most influence on inlining decisions when optimizing for size. On the other hand, there was no good default value for this parameter. Some benchmarks profited strongly from a reduced call penalty. On example is the picojpeg benchmark compiled for RISC-V, which got 6% smaller with a CallPenalty of 10 instead of 12. Other benchmarks increased in size, like matmult. This commit makes the compromise of turning the magic number constant of CallPenalty into a configurable value. This introduces the flag `--inline-call-penalty`. With that flag users can fine tune the inliner to their needs. The CallPenalty constant was also used for loops. This commit replaces the CallPenalty constant with a new LoopPenalty constant that is now used instead. This is a slimmed down version of https://reviews.llvm.org/D30899 [1]: https://github.com/embench/embench-iot Differential Revision: https://reviews.llvm.org/D105976
Diffstat (limited to 'llvm/lib/CodeGen/MachineFunction.cpp')
0 files changed, 0 insertions, 0 deletions