[PATCH] Take branch misprediction effects into account when RTL loop unrolling (issue 6099055)

davidxl@google.com davidxl@google.com
Wed Apr 25 05:22:00 GMT 2012


http://codereview.appspot.com/6099055/diff/1/loop-unroll.c
File loop-unroll.c (right):

http://codereview.appspot.com/6099055/diff/1/loop-unroll.c#newcode156
loop-unroll.c:156: static bool
An empty line here.

http://codereview.appspot.com/6099055/diff/1/loop-unroll.c#newcode182
loop-unroll.c:182: static bool
add empty line after comment.

http://codereview.appspot.com/6099055/diff/1/loop-unroll.c#newcode213
loop-unroll.c:213: /* Compute the number of branches in LOOP, weighted
by execution counts.  */
same here.

http://codereview.appspot.com/6099055/diff/1/loop-unroll.c#newcode215
loop-unroll.c:215: compute_weighted_branches(struct loop *loop)
Missing space. Similarly for other functions.

http://codereview.appspot.com/6099055/diff/1/loop-unroll.c#newcode255
loop-unroll.c:255: data exists, simply return the current NUNROLL
factor.  */
same here.

http://codereview.appspot.com/6099055/diff/1/loop-unroll.c#newcode281
loop-unroll.c:281: while (loop_outer(outer))
Should the check start from the current loop? Or the handling of the
current loop should be peeled out -- max_unroll_factor =
branch_budget/weighted_num_branches

http://codereview.appspot.com/6099055/diff/1/loop-unroll.c#newcode317
loop-unroll.c:317: return (PARAM_VALUE
(PARAM_UNROLL_OUTER_LOOP_BRANCH_BUDGET) -
The number of branches may be larger than budget --> leading to overflow
-- need to guard against it.

http://codereview.appspot.com/6099055/diff/1/loop-unroll.c#newcode318
loop-unroll.c:318: weighted_outer_branches)/(weighted_num_branches - 1)
+ 1;
Should it continue walking up the loop tree and find the minmal unroll
factor?

http://codereview.appspot.com/6099055/diff/1/loop-unroll.c#newcode747
loop-unroll.c:747: && loop_has_FP_comp(loop)
missing space

http://codereview.appspot.com/6099055/diff/1/loop-unroll.c#newcode749
loop-unroll.c:749: && desc->niter < (unsigned) PARAM_VALUE
(PARAM_MIN_ITER_UNROLL_WITH_BRANCHES))
line too long.

http://codereview.appspot.com/6099055/diff/1/loop-unroll.c#newcode1057
loop-unroll.c:1057: && loop_has_FP_comp(loop)
Refactor the check into a helper function?

http://codereview.appspot.com/6099055/diff/1/params.def
File params.def (right):

http://codereview.appspot.com/6099055/diff/1/params.def#newcode314
params.def:314:
Missing comment.

http://codereview.appspot.com/6099055/diff/1/params.def#newcode319
params.def:319:
missing comment.

http://codereview.appspot.com/6099055/



More information about the Gcc-patches mailing list