This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [PATCH] Pass down branch probability through dojump.c functions (PR middle-end/42233)


On Fri, Feb 19, 2010 at 01:55:54PM +0100, Jakub Jelinek wrote:
> On Fri, Feb 19, 2010 at 10:37:22AM +0100, Richard Guenther wrote:
> > > Bootstrapped/regtested on x86_64-linux and i686-linux. ?Ok for trunk?
> > 
> > Ok.
> 
> As pointed out by Andreas, I've missed one spot in loop-doloop.c that also
> needs adjusting (and didn't show up in x86_64-linux nor i686-linux
> bootstrap).  Committed as obvious.

And here is another follow-up, while backporting the patchset to 4.4 branch
I've noticed I've screwed up TRUTH_NOT_EXPR handling.  As TRUTH_NOT_EXPR
swaps true/false labels, it needs to invert the probability as well.
Will commit as obvious momentarily:

2010-02-19  Jakub Jelinek  <jakub@redhat.com>

	PR middle-end/42233
	* dojump.c (do_jump) <case TRUTH_NOT_EXPR>: Invert priority.

--- gcc/dojump.c.jj	2010-02-19 09:26:14.000000000 +0100
+++ gcc/dojump.c	2010-02-19 19:00:42.000000000 +0100
@@ -411,7 +411,8 @@ do_jump (tree exp, rtx if_false_label, r
       break;
 
     case TRUTH_NOT_EXPR:
-      do_jump (TREE_OPERAND (exp, 0), if_true_label, if_false_label, prob);
+      do_jump (TREE_OPERAND (exp, 0), if_true_label, if_false_label,
+	       inv (prob));
       break;
 
     case COND_EXPR:

	Jakub


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]