Re: Propagate profile counts during switch expansion

2012-10-17 Thread Gary Funck
On 10/08/12 17:46:03, Easwaran Raman wrote: I have attached a revised patch. The updated ChangeLog is given below and I have responded to your comments inline: 2012-10-08 Easwaran Raman era...@google.com * optabs.c (emit_cmp_and_jump_insn_1): Add a new parameter to specificy the

Re: Propagate profile counts during switch expansion

2012-10-15 Thread Easwaran Raman
On Sun, Oct 14, 2012 at 8:09 AM, Jan Hubicka hubi...@ucw.cz wrote: Hi, Index: optabs.c === --- optabs.c(revision 191879) +++ optabs.c(working copy) @@ -4249,7 +4249,7 @@ prepare_operand (enum insn_code icode, rtx x, int

Re: Propagate profile counts during switch expansion

2012-10-15 Thread Jan Hubicka
On Sun, Oct 14, 2012 at 8:09 AM, Jan Hubicka hubi...@ucw.cz wrote: Hi, Index: optabs.c === --- optabs.c(revision 191879) +++ optabs.c(working copy) @@ -4249,7 +4249,7 @@ prepare_operand (enum insn_code icode,

Re: Propagate profile counts during switch expansion

2012-10-14 Thread Jan Hubicka
Hi, Index: optabs.c === --- optabs.c(revision 191879) +++ optabs.c(working copy) @@ -4249,7 +4249,7 @@ prepare_operand (enum insn_code icode, rtx x, int we can do the branch. */ static void -emit_cmp_and_jump_insn_1

Re: Propagate profile counts during switch expansion

2012-10-13 Thread Easwaran Raman
Ping. On Mon, Oct 8, 2012 at 5:46 PM, Easwaran Raman era...@google.com wrote: I have attached a revised patch. The updated ChangeLog is given below and I have responded to your comments inline: 2012-10-08 Easwaran Raman era...@google.com * optabs.c (emit_cmp_and_jump_insn_1): Add a new

Re: Propagate profile counts during switch expansion

2012-10-06 Thread Jan Hubicka
+ + default_edge-count = default_count; + if (count) +{ + edge e; + edge_iterator ei; + FOR_EACH_EDGE (e, ei, stmt_bb-succs) +e-probability = e-count * REG_BR_PROB_BASE / count; +} Hmm, this updates origina BB containing the

Re: Propagate profile counts during switch expansion

2012-10-04 Thread Jan Hubicka
Hi, This patch propagates the profile counts during RTL expansion. In many cases, there is no way to determine the exact count of an edge generated during the expansion. So this patch uses some simple heuristics to estimate the edge counts but ensures that the counts of the basic blocks

Re: Propagate profile counts during switch expansion

2012-10-04 Thread Easwaran Raman
Hi Honza, I am addressing some of the questions you raise here. Will send an updated patch later. On Thu, Oct 4, 2012 at 6:19 AM, Jan Hubicka hubi...@ucw.cz wrote: @@ -560,7 +577,6 @@ compute_outgoing_frequencies (basic_block b) return; } } - if (single_succ_p (b))

Re: Propagate profile counts during switch expansion

2012-10-03 Thread Xinliang David Li
What is the status of switch expansion GIMPLE rewrite? If it is not planned for 4.8, It will be desirable to include this fix into trunk. It also helps set up a good base line to test against regression. thanks, David On Tue, Oct 2, 2012 at 6:09 PM, Easwaran Raman era...@google.com wrote: Hi,

Re: Propagate profile counts during switch expansion

2012-10-03 Thread Steven Bosscher
On Wed, Oct 3, 2012 at 6:12 PM, Xinliang David Li davi...@google.com wrote: What is the status of switch expansion GIMPLE rewrite? If it is not planned for 4.8, It will be desirable to include this fix into trunk. I could work on it for GCC 4.8 (there's not a lot of work left to be done for it

Re: Propagate profile counts during switch expansion

2012-10-03 Thread Xinliang David Li
thanks for the update! David On Wed, Oct 3, 2012 at 10:37 AM, Steven Bosscher stevenb@gmail.com wrote: On Wed, Oct 3, 2012 at 6:12 PM, Xinliang David Li davi...@google.com wrote: What is the status of switch expansion GIMPLE rewrite? If it is not planned for 4.8, It will be desirable to

Re: Propagate profile counts during switch expansion

2012-10-03 Thread Jan Hubicka
thanks for the update! OK, I will review the patch tomorrow then. It is a good incremental step. I would certainly like to see the gimple expansion in 4.8 however. Honza

Propagate profile counts during switch expansion

2012-10-02 Thread Easwaran Raman
Hi, This patch propagates the profile counts during RTL expansion. In many cases, there is no way to determine the exact count of an edge generated during the expansion. So this patch uses some simple heuristics to estimate the edge counts but ensures that the counts of the basic blocks