[LLVMdev] How to control inlining in llvm?
Roel Jordans
r.jordans at tue.nl
Tue Jul 1 02:31:30 PDT 2014
In general llvm based tools have a -help-hidden option which will show
you all parameters that can be tuned.
opt -help-hidden has the following:
-inline-threshold=<int> - Control the amount of inlining to perform
(default = 225)
-inlinehint-threshold=<int> - Threshold for inlining functions with
inline hint
clang allows you to pass options through opt by using -mllvm -option
I guess you're looking for something like:
clang -mllvm -inline-threshold=100000 ...
Cheers,
Roel
On 30/06/14 20:30, Yuri wrote:
> I asked this question before, but wasn't satisfied with answers.
>
> How can (expert) users control inlining in llvm? gcc has these
> parameters: -finline-limit, --param max-inline-insns-single, --param
> inline-unit-growth, etc. What are the llvm equivalents?
>
> While running large and complex industrial processes, I found that
> inlining can significantly change the speed of individual processes.
> Usually the more inlining there is, the faster the process runs. In gcc
> I actually was setting insanely high inlining values because that's what
> usually gave the fastest code, even though there should be some limit
> after which speed should theoretically degrade.
>
> Now it looks like there are no llvm equivalents.
>
> Answers given before are these: compiler should know better how to
> inline, users should trust compiler to "do the right thing", such
> options might not be stable between versions, compiler should just be
> faster without any such flags, many users will be tempted to set some
> values they don't understand and they will be floating in their
> makefiles forever without meaning.
>
> For someone who is after the wall clock time such answers are naive.
> Compiler can't predict what heuristics the resulting code will exhibit
> under particular conditions. Maybe I want to inline 2X or 5X more than
> -O3 allows, and I am willing to spend this CPU time on compile and see.
> There are customers for which 10% improvement means a lot of difference.
> Why does llvm take away such choice from the users?
>
> This lack of inlining tuning variables is a sticking point for me in
> switching to clang.
>
> Yuri
> _______________________________________________
> LLVM Developers mailing list
> LLVMdev at cs.uiuc.edu http://llvm.cs.uiuc.edu
> http://lists.cs.uiuc.edu/mailman/listinfo/llvmdev
More information about the llvm-dev
mailing list