Before this commit we compared the total function size plus the callee size to the threshold. With this commit we use the threshold as the inlining budget and we keep inlining until we run out of our budget.
Swift SVN r12424
Teach the mandatory inliner to drop debug_value[_addr] instructions
when inlining. Otherwise, we get debug_value's for all of the arguments
splattered all over the place. We want transparent functions to be
effectively ((nodebug)) in C parlance.
Swift SVN r12404
The compile times of stdlib drops by a few seconds and the code quality of a few small testcases that
I have been playing with improves.
Swift SVN r11718
This is a very initial version mostly to get machinery in place before we start
considering more interesting things.
Specifically we do not:
1. Inline functions with any substitutions.
2. Inline functions that are not thin.
3. Inline functions in any recursive manner (i.e. we just follow the call tree
and inline until we run out of cost).
4. Remove functions that we have completely inlined as a good citizen should.
Additionally the cost model is purposely simplistic and assumes that every SIL
instruction is one to one with an LLVM instruction (when many do not become any
LLVM instruction and others become 2). The idea is simply to put a cost on the
total increase in code size we allow due to inlining in a specific function.
Thus we just continually inline until we run out our inlining budget.
Even with the current limitations we inline 1248 apply inst in the stdlib when
setting a cost threshold of 225.
Swift SVN r11596