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 ping: Add static branch predict heuristic of comparing IV to loop_bound variable


On Fri, May 04, 2012 at 09:46:22PM +0800, Dehao Chen wrote:
> Thanks for the prompt response. Attached is the updated patch.
> 
> Passed bootstrap and all regression tests.

All the new testcases fail for me, on both x86_64-linux and i686-linux,
apparently because of incorrectly committed patch (each testcase source
contains the test twice).

Also, the ChangeLog entries are missing dot at end of each change
description (New instead of New. etc.).

> Index: gcc/testsuite/gcc.dg/predict-3.c
> ===================================================================
> --- gcc/testsuite/gcc.dg/predict-3.c	(revision 0)
> +++ gcc/testsuite/gcc.dg/predict-3.c	(revision 0)
> @@ -0,0 +1,25 @@
> +/* { dg-do compile } */
> +/* { dg-options "-O2 -fdump-tree-profile_estimate" } */
> +
> +extern int global;
> +
> +int bar(int);
> +
> +void foo (int bound)
> +{
> +  int i, ret = 0;
> +  for (i = 0; i <= bound; i++)
> +    {
> +      if (i < bound - 2)
> +	global += bar (i);
> +      if (i <= bound)
> +	global += bar (i);
> +      if (i + 1 < bound)
> +	global += bar (i);
> +      if (i != bound)
> +	global += bar (i);
> +    }
> +}
> +
> +/* { dg-final { scan-tree-dump-times "loop iv compare heuristics:
> 100.0%" 4 "profile_estimate"} } */
> +/* { dg-final { cleanup-tree-dump "profile_estimate" } } */

	Jakub


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