diff options
author | Richard Guenther <rguenther@suse.de> | 2009-06-13 17:02:17 +0000 |
---|---|---|
committer | Richard Biener <rguenth@gcc.gnu.org> | 2009-06-13 17:02:17 +0000 |
commit | e1e6dc737e629e7280e70dbd403d0d6da9c4e1a6 (patch) | |
tree | fb00355fe92d76940dd67a378dc9567090718ab5 /gcc/tree-predcom.c | |
parent | 8012b92326d303302b5aa912752ab99348d3b6aa (diff) | |
download | gcc-e1e6dc737e629e7280e70dbd403d0d6da9c4e1a6.zip gcc-e1e6dc737e629e7280e70dbd403d0d6da9c4e1a6.tar.gz gcc-e1e6dc737e629e7280e70dbd403d0d6da9c4e1a6.tar.bz2 |
re PR tree-optimization/40421 (Revision 148352 failed 416.gamess in SPEC CPU 2006)
2009-06-13 Richard Guenther <rguenther@suse.de>
PR tree-optimization/40389
* tree-predcom.c (should_unroll_loop_p): Remove.
(tree_predictive_commoning_loop): Use can_unroll_loop_p.
* gfortran.fortran-torture/compile/pr40421.f: New testcase.
From-SVN: r148458
Diffstat (limited to 'gcc/tree-predcom.c')
-rw-r--r-- | gcc/tree-predcom.c | 40 |
1 files changed, 2 insertions, 38 deletions
diff --git a/gcc/tree-predcom.c b/gcc/tree-predcom.c index 7ebd6c0..5d8bf4d 100644 --- a/gcc/tree-predcom.c +++ b/gcc/tree-predcom.c @@ -1870,43 +1870,6 @@ execute_pred_commoning_cbck (struct loop *loop, void *data) execute_pred_commoning (loop, dta->chains, dta->tmp_vars); } -/* Returns true if we can and should unroll LOOP FACTOR times. Number - of iterations of the loop is returned in NITER. */ - -static bool -should_unroll_loop_p (struct loop *loop, unsigned factor, - struct tree_niter_desc *niter) -{ - edge exit; - - if (factor == 1) - return false; - - /* Check whether unrolling is possible. We only want to unroll loops - for that we are able to determine number of iterations. We also - want to split the extra iterations of the loop from its end, - therefore we require that the loop has precisely one - exit. */ - - exit = single_dom_exit (loop); - if (!exit) - return false; - - if (!number_of_iterations_exit (loop, exit, niter, false)) - return false; - - /* And of course, we must be able to duplicate the loop. */ - if (!can_duplicate_loop_p (loop)) - return false; - - /* The final loop should be small enough. */ - if (tree_num_loop_insns (loop, &eni_size_weights) * factor - > (unsigned) PARAM_VALUE (PARAM_MAX_UNROLLED_INSNS)) - return false; - - return true; -} - /* Base NAME and all the names in the chain of phi nodes that use it on variable VAR. The phi nodes are recognized by being in the copies of the header of the LOOP. */ @@ -2544,7 +2507,8 @@ tree_predictive_commoning_loop (struct loop *loop) that its number of iterations is divisible by the factor. */ unroll_factor = determine_unroll_factor (chains); scev_reset (); - unroll = should_unroll_loop_p (loop, unroll_factor, &desc); + unroll = (unroll_factor > 1 + && can_unroll_loop_p (loop, unroll_factor, &desc)); exit = single_dom_exit (loop); /* Execute the predictive commoning transformations, and possibly unroll the |