This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [PATCH] Improve probability/profile distribution in ORIF expansion
- From: Jan Hubicka <hubicka at ucw dot cz>
- To: Teresa Johnson <tejohnson at google dot com>
- Cc: Jan Hubicka <hubicka at ucw dot cz>, "gcc-patches at gcc dot gnu dot org" <gcc-patches at gcc dot gnu dot org>, David Li <davidxl at google dot com>
- Date: Wed, 2 Oct 2013 18:03:16 +0200
- Subject: Re: [PATCH] Improve probability/profile distribution in ORIF expansion
- Authentication-results: sourceware.org; auth=none
- References: <CAAe5K+Xy_XthATu5P_YtdTuFRzLwEN-iYfkKuh-9T9qKEP=gYw at mail dot gmail dot com>
> 2013-10-01 Teresa Johnson <tejohnson@google.com>
>
> * dojump.c (do_jump_1): Divide probability between
> both conditions of a TRUTH_ORIF_EXPR.
>
> + {
> + /* Spread the probability evenly between the two conditions. So
> + the first condition has half the total probability of being true.
> + The second condition has the other half of the total probability,
> + so its jump has a probability of half the total, relative to
> + the probability we reached it (i.e. the first condition
> was false). */
> + int op0_prob = prob / 2;
> + int op1_prob = GCOV_COMPUTE_SCALE ((prob / 2), inv (op0_prob));
Documentation of the functions says that PROB may be -1 when it is unknown, In that
case you want to arrange op0_prob=op1_prob = -1.
What about TRUTH_ANDIF_EXPR code above? I think it needs similar adjusting
Patch is preaproved with these changes.
Thanks!
Honza