Commit Graph

115 Commits

Author SHA1 Message Date
Nadav Rotem
0e1f77dcbc Change the perf-inliner heuristics to a simple threshold check.
This does not change the performance of our tiny test suite, probably because
we run the optimizations multiple times.


Swift SVN r12659
2014-01-21 21:39:32 +00:00
Michael Gottesman
ba161742db [performance-inliner] The inliner can in principle inline function_refs which point at functions with the objc_method calling convention.
Swift SVN r12643
2014-01-21 17:12:12 +00:00
Michael Gottesman
acd151f40a [performance-inliner] A gep of a hasOneUse gep will get folded by LLVM into one gep. In that case the second should be free.
Swift SVN r12642
2014-01-21 17:12:11 +00:00
Michael Gottesman
a1d866487c [performance-inliner] We can inline function_ref with c and witness_method calling conventions.
Swift SVN r12638
2014-01-21 08:23:23 +00:00
Nadav Rotem
66f54f7ddf Performance Inliner: Change the cost calculation method.
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
2014-01-16 22:26:26 +00:00
Nadav Rotem
df35a1251e Adding debug prints.
Swift SVN r12409
2014-01-16 19:03:59 +00:00
Nadav Rotem
5f18a43724 More cleanups.
Swift SVN r12408
2014-01-16 18:56:24 +00:00
Nadav Rotem
4f2ad363a3 Small cleanups.
Swift SVN r12407
2014-01-16 18:51:15 +00:00
Chris Lattner
79cbdc5c32 Teach the performance inliner that debug_value[_addr] are free.
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
2014-01-16 16:06:47 +00:00
Michael Gottesman
88f323320e [sil-inliner] We want to always inline transparent functions if they reach the performance inliner. Make the cost of a transparent function 0.
rdar://15767012

Swift SVN r12037
2014-01-08 03:10:41 +00:00
Michael Gottesman
10e1d4504a [sil-inliner] Remove string_literal from the list of instructions which do not add any inline cost.
Swift SVN r12007
2014-01-07 19:35:22 +00:00
Nadav Rotem
fc6d887858 no need for period.
Swift SVN r11736
2013-12-30 07:47:46 +00:00
Nadav Rotem
faab3ca3d8 Reduce the inliner threshold and enable the early inliner.
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
2013-12-29 18:33:38 +00:00
Michael Gottesman
3396bdfc2c [sil-inliner] Teach the inliner that literals are free since they just become LLVM values.
Swift SVN r11603
2013-12-23 06:55:41 +00:00
Michael Gottesman
b6f8bd9a55 Initial simple cost based performance inliner.
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
2013-12-23 06:00:57 +00:00