diff options
author | Ulrich Weigand <ulrich.weigand@linaro.org> | 2012-06-26 09:05:48 +0000 |
---|---|---|
committer | Ulrich Weigand <uweigand@gcc.gnu.org> | 2012-06-26 09:05:48 +0000 |
commit | 38eec4c652ecafe1056be45914e0a906e7d43c44 (patch) | |
tree | cd00eac064512bb0c8c0e08fc883a8a88233df53 /gcc | |
parent | e4ae19bc4c940dcc7bc89eecd60d75dc7e17dd5c (diff) | |
download | gcc-38eec4c652ecafe1056be45914e0a906e7d43c44.zip gcc-38eec4c652ecafe1056be45914e0a906e7d43c44.tar.gz gcc-38eec4c652ecafe1056be45914e0a906e7d43c44.tar.bz2 |
re PR regression/53729 (PR53636 fix caused bb-slp-16.c to FAIL on sparc64 and powerpc64)
PR tree-optimization/53729
PR tree-optimization/53636
* tree-vect-slp.c (vect_slp_analyze_bb_1): Delay call to
vect_verify_datarefs_alignment until after statements have
been marked as relevant/irrelevant.
* tree-vect-data-refs.c (vect_verify_datarefs_alignment):
Skip irrelevant statements.
(vect_enhance_data_refs_alignment): Use STMT_VINFO_RELEVANT_P
instead of STMT_VINFO_RELEVANT.
(vect_get_data_access_cost): Do not check for supportable
alignment before calling vect_get_load_cost/vect_get_store_cost.
* tree-vect-stmts.c (vect_get_store_cost): Do not abort when
handling unsupported alignment.
(vect_get_load_cost): Likewise.
From-SVN: r188979
Diffstat (limited to 'gcc')
-rw-r--r-- | gcc/ChangeLog | 17 | ||||
-rw-r--r-- | gcc/tree-vect-data-refs.c | 17 | ||||
-rw-r--r-- | gcc/tree-vect-slp.c | 20 | ||||
-rw-r--r-- | gcc/tree-vect-stmts.c | 20 |
4 files changed, 54 insertions, 20 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 12f2404..356d201 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,20 @@ +2012-06-26 Ulrich Weigand <ulrich.weigand@linaro.org> + + PR tree-optimization/53729 + PR tree-optimization/53636 + * tree-vect-slp.c (vect_slp_analyze_bb_1): Delay call to + vect_verify_datarefs_alignment until after statements have + been marked as relevant/irrelevant. + * tree-vect-data-refs.c (vect_verify_datarefs_alignment): + Skip irrelevant statements. + (vect_enhance_data_refs_alignment): Use STMT_VINFO_RELEVANT_P + instead of STMT_VINFO_RELEVANT. + (vect_get_data_access_cost): Do not check for supportable + alignment before calling vect_get_load_cost/vect_get_store_cost. + * tree-vect-stmts.c (vect_get_store_cost): Do not abort when + handling unsupported alignment. + (vect_get_load_cost): Likewise. + 2012-06-25 Steven Bosscher <steven@gcc.gnu.org> * config/rl78/rl78.h: Do not undefine DONT_USE_BUILTIN_SETJMP. diff --git a/gcc/tree-vect-data-refs.c b/gcc/tree-vect-data-refs.c index 42f5518..34afd05 100644 --- a/gcc/tree-vect-data-refs.c +++ b/gcc/tree-vect-data-refs.c @@ -1094,6 +1094,9 @@ vect_verify_datarefs_alignment (loop_vec_info loop_vinfo, bb_vec_info bb_vinfo) gimple stmt = DR_STMT (dr); stmt_vec_info stmt_info = vinfo_for_stmt (stmt); + if (!STMT_VINFO_RELEVANT_P (stmt_info)) + continue; + /* For interleaving, only the alignment of the first access matters. Skip statements marked as not vectorizable. */ if ((STMT_VINFO_GROUPED_ACCESS (stmt_info) @@ -1213,17 +1216,11 @@ vect_get_data_access_cost (struct data_reference *dr, loop_vec_info loop_vinfo = STMT_VINFO_LOOP_VINFO (stmt_info); int vf = LOOP_VINFO_VECT_FACTOR (loop_vinfo); int ncopies = vf / nunits; - bool supportable_dr_alignment = vect_supportable_dr_alignment (dr, true); - if (!supportable_dr_alignment) - *inside_cost = VECT_MAX_COST; + if (DR_IS_READ (dr)) + vect_get_load_cost (dr, ncopies, true, inside_cost, outside_cost); else - { - if (DR_IS_READ (dr)) - vect_get_load_cost (dr, ncopies, true, inside_cost, outside_cost); - else - vect_get_store_cost (dr, ncopies, inside_cost); - } + vect_get_store_cost (dr, ncopies, inside_cost); if (vect_print_dump_info (REPORT_COST)) fprintf (vect_dump, "vect_get_data_access_cost: inside_cost = %d, " @@ -1537,7 +1534,7 @@ vect_enhance_data_refs_alignment (loop_vec_info loop_vinfo) stmt = DR_STMT (dr); stmt_info = vinfo_for_stmt (stmt); - if (!STMT_VINFO_RELEVANT (stmt_info)) + if (!STMT_VINFO_RELEVANT_P (stmt_info)) continue; /* For interleaving, only the alignment of the first access diff --git a/gcc/tree-vect-slp.c b/gcc/tree-vect-slp.c index 0692d0b..5d11552 100644 --- a/gcc/tree-vect-slp.c +++ b/gcc/tree-vect-slp.c @@ -2050,16 +2050,6 @@ vect_slp_analyze_bb_1 (basic_block bb) return NULL; } - if (!vect_verify_datarefs_alignment (NULL, bb_vinfo)) - { - if (vect_print_dump_info (REPORT_UNVECTORIZED_LOCATIONS)) - fprintf (vect_dump, "not vectorized: unsupported alignment in basic " - "block.\n"); - - destroy_bb_vec_info (bb_vinfo); - return NULL; - } - /* Check the SLP opportunities in the basic block, analyze and build SLP trees. */ if (!vect_analyze_slp (NULL, bb_vinfo)) @@ -2082,6 +2072,16 @@ vect_slp_analyze_bb_1 (basic_block bb) vect_mark_slp_stmts_relevant (SLP_INSTANCE_TREE (instance)); } + if (!vect_verify_datarefs_alignment (NULL, bb_vinfo)) + { + if (vect_print_dump_info (REPORT_UNVECTORIZED_LOCATIONS)) + fprintf (vect_dump, "not vectorized: unsupported alignment in basic " + "block.\n"); + + destroy_bb_vec_info (bb_vinfo); + return NULL; + } + if (!vect_slp_analyze_operations (bb_vinfo)) { if (vect_print_dump_info (REPORT_UNVECTORIZED_LOCATIONS)) diff --git a/gcc/tree-vect-stmts.c b/gcc/tree-vect-stmts.c index 5853d4f..010181c 100644 --- a/gcc/tree-vect-stmts.c +++ b/gcc/tree-vect-stmts.c @@ -931,6 +931,16 @@ vect_get_store_cost (struct data_reference *dr, int ncopies, break; } + case dr_unaligned_unsupported: + { + *inside_cost = VECT_MAX_COST; + + if (vect_print_dump_info (REPORT_COST)) + fprintf (vect_dump, "vect_model_store_cost: unsupported access."); + + break; + } + default: gcc_unreachable (); } @@ -1094,6 +1104,16 @@ vect_get_load_cost (struct data_reference *dr, int ncopies, break; } + case dr_unaligned_unsupported: + { + *inside_cost = VECT_MAX_COST; + + if (vect_print_dump_info (REPORT_COST)) + fprintf (vect_dump, "vect_model_load_cost: unsupported access."); + + break; + } + default: gcc_unreachable (); } |