diff options
author | Dorit Nuzman <dorit@il.ibm.com> | 2007-12-17 11:13:56 +0000 |
---|---|---|
committer | Dorit Nuzman <dorit@gcc.gnu.org> | 2007-12-17 11:13:56 +0000 |
commit | ca7b051775437a3002bdfd9a7d0aebb092095f05 (patch) | |
tree | f8dea64c0bc26b2701c69ead0093db178c2940f3 /gcc/tree-vect-transform.c | |
parent | 5287c2bcadea2a91cb66ceaa87a442771aa50fce (diff) | |
download | gcc-ca7b051775437a3002bdfd9a7d0aebb092095f05.zip gcc-ca7b051775437a3002bdfd9a7d0aebb092095f05.tar.gz gcc-ca7b051775437a3002bdfd9a7d0aebb092095f05.tar.bz2 |
re PR tree-optimization/34445 (internal compiler error: in cost_for_stmt, at tree-vect-transform.c:98)
PR tree-optimization/34445
* tree-vect-trasnform.c (vect_estimate_min_profitable_iters): Skip
stmts (including live stmts) that are not relevant.
From-SVN: r131006
Diffstat (limited to 'gcc/tree-vect-transform.c')
-rw-r--r-- | gcc/tree-vect-transform.c | 21 |
1 files changed, 11 insertions, 10 deletions
diff --git a/gcc/tree-vect-transform.c b/gcc/tree-vect-transform.c index 09e91b9..8b22dca 100644 --- a/gcc/tree-vect-transform.c +++ b/gcc/tree-vect-transform.c @@ -197,18 +197,19 @@ vect_estimate_min_profitable_iters (loop_vec_info loop_vinfo) factor = 1; for (si = bsi_start (bb); !bsi_end_p (si); bsi_next (&si)) - { - tree stmt = bsi_stmt (si); - stmt_vec_info stmt_info = vinfo_for_stmt (stmt); - if (!STMT_VINFO_RELEVANT_P (stmt_info) - && !STMT_VINFO_LIVE_P (stmt_info)) - continue; - scalar_single_iter_cost += cost_for_stmt (stmt) * factor; - vec_inside_cost += STMT_VINFO_INSIDE_OF_LOOP_COST (stmt_info) * factor; + { + tree stmt = bsi_stmt (si); + stmt_vec_info stmt_info = vinfo_for_stmt (stmt); + /* Skip stmts that are not vectorized inside the loop. */ + if (!STMT_VINFO_RELEVANT_P (stmt_info) + && STMT_VINFO_DEF_TYPE (stmt_info) != vect_reduction_def) + continue; + scalar_single_iter_cost += cost_for_stmt (stmt) * factor; + vec_inside_cost += STMT_VINFO_INSIDE_OF_LOOP_COST (stmt_info) * factor; /* FIXME: for stmts in the inner-loop in outer-loop vectorization, some of the "outside" costs are generated inside the outer-loop. */ - vec_outside_cost += STMT_VINFO_OUTSIDE_OF_LOOP_COST (stmt_info); - } + vec_outside_cost += STMT_VINFO_OUTSIDE_OF_LOOP_COST (stmt_info); + } } /* Add additional cost for the peeled instructions in prologue and epilogue |