Re: Cost model for indirect call speculation

2013-08-12 Thread David Malcolm
On Mon, 2013-08-12 at 01:11 +0200, Jan Hubicka wrote: > Hi, > this patch adds simple cost model into indirect call speculation. [...] > Index: cgraph.c [...] > *** cgraph_resolve_speculation (struct cgrap > ! fprintf (dump_file, "Speculative indirect call %s/%i => %s/%i has

Re: Cost model for indirect call speculation

2013-08-12 Thread Andi Kleen
Xinliang David Li writes: > I like the approach in general -- in the past, indirect call promotion > and function inlining heuristics are disconnected -- which can lead to > either missing promotions or useless ones. This approach solves the > problem. > > On Sun, Aug 11, 2013 at 4:11 PM, Jan Hu

Re: Cost model for indirect call speculation

2013-08-11 Thread Xinliang David Li
I like the approach in general -- in the past, indirect call promotion and function inlining heuristics are disconnected -- which can lead to either missing promotions or useless ones. This approach solves the problem. On Sun, Aug 11, 2013 at 4:11 PM, Jan Hubicka wrote: > Hi, > this patch adds s

Cost model for indirect call speculation

2013-08-11 Thread Jan Hubicka
Hi, this patch adds simple cost model into indirect call speculation. First we do not turn calls into speculative calls when it seems bad idea (i.e. call is cold) and during inlining we remove speculations that do not seem benefical. On modern chip speculative call sequence without inlining is no