This is the mail archive of the gcc-cvs@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]

r187662 - in /branches/google/gcc-4_7/gcc: Chan...


Author: tejohnson
Date: Fri May 18 16:58:25 2012
New Revision: 187662

URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=187662
Log:
2012-05-18   Teresa Johnson  <tejohnson@google.com>

	Backport from google/main r187660:

This patch adds heuristics to limit unrolling in loops with branches that may increase
branch mispredictions. It affects loops that are not frequently iterated, and that are
nested within a hot region of code that already contains many branch instructions.

        2012-05-18   Teresa Johnson  <tejohnson@google.com>

	* doc/invoke.texi: Update the documentation with new params.
	* loop-unroll.c (loop_has_FP_comp): Remove function.
	(max_unroll_with_branches): New function.
	(decide_unroll_constant_iterations, decide_unroll_runtime_iterations):
        Add heuristic to avoid increasing branch mispredicts when unrolling.
	(limit_code_size, decide_peel_simple, decide_unroll_stupid): Retrieve
        number of branches from niter_desc instead of via function that walks
        loop.
	* loop-iv.c (get_simple_loop_desc): Invoke new analyze_loop_insns
        function, and add guards to enable this function to work for the
        outermost loop.
	* cfgloop.c (insn_has_fp_set, analyze_loop_insns): New functions.
        (num_loop_branches): Remove.
	* cfgloop.h (struct niter_desc): Added new fields to cache additional
        loop analysis information.
        (num_loop_branches): Remove.
	(analyze_loop_insns): Declare.
	* params.def (PARAM_MIN_ITER_UNROLL_WITH_BRANCHES): New param.
        (PARAM_UNROLL_OUTER_LOOP_BRANCH_BUDGET): Ditto.

Modified:
    branches/google/gcc-4_7/gcc/ChangeLog.google-4_7
    branches/google/gcc-4_7/gcc/cfgloop.c
    branches/google/gcc-4_7/gcc/cfgloop.h
    branches/google/gcc-4_7/gcc/doc/invoke.texi
    branches/google/gcc-4_7/gcc/loop-iv.c
    branches/google/gcc-4_7/gcc/loop-unroll.c
    branches/google/gcc-4_7/gcc/params.def


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