Commit 38eec4c6 by Ulrich Weigand Committed by Ulrich Weigand

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
parent e4ae19bc
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> 2012-06-25 Steven Bosscher <steven@gcc.gnu.org>
* config/rl78/rl78.h: Do not undefine DONT_USE_BUILTIN_SETJMP. * config/rl78/rl78.h: Do not undefine DONT_USE_BUILTIN_SETJMP.
......
...@@ -1094,6 +1094,9 @@ vect_verify_datarefs_alignment (loop_vec_info loop_vinfo, bb_vec_info bb_vinfo) ...@@ -1094,6 +1094,9 @@ vect_verify_datarefs_alignment (loop_vec_info loop_vinfo, bb_vec_info bb_vinfo)
gimple stmt = DR_STMT (dr); gimple stmt = DR_STMT (dr);
stmt_vec_info stmt_info = vinfo_for_stmt (stmt); 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. /* For interleaving, only the alignment of the first access matters.
Skip statements marked as not vectorizable. */ Skip statements marked as not vectorizable. */
if ((STMT_VINFO_GROUPED_ACCESS (stmt_info) if ((STMT_VINFO_GROUPED_ACCESS (stmt_info)
...@@ -1213,17 +1216,11 @@ vect_get_data_access_cost (struct data_reference *dr, ...@@ -1213,17 +1216,11 @@ vect_get_data_access_cost (struct data_reference *dr,
loop_vec_info loop_vinfo = STMT_VINFO_LOOP_VINFO (stmt_info); loop_vec_info loop_vinfo = STMT_VINFO_LOOP_VINFO (stmt_info);
int vf = LOOP_VINFO_VECT_FACTOR (loop_vinfo); int vf = LOOP_VINFO_VECT_FACTOR (loop_vinfo);
int ncopies = vf / nunits; int ncopies = vf / nunits;
bool supportable_dr_alignment = vect_supportable_dr_alignment (dr, true);
if (!supportable_dr_alignment) if (DR_IS_READ (dr))
*inside_cost = VECT_MAX_COST; vect_get_load_cost (dr, ncopies, true, inside_cost, outside_cost);
else else
{ vect_get_store_cost (dr, ncopies, inside_cost);
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);
}
if (vect_print_dump_info (REPORT_COST)) if (vect_print_dump_info (REPORT_COST))
fprintf (vect_dump, "vect_get_data_access_cost: inside_cost = %d, " 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) ...@@ -1537,7 +1534,7 @@ vect_enhance_data_refs_alignment (loop_vec_info loop_vinfo)
stmt = DR_STMT (dr); stmt = DR_STMT (dr);
stmt_info = vinfo_for_stmt (stmt); stmt_info = vinfo_for_stmt (stmt);
if (!STMT_VINFO_RELEVANT (stmt_info)) if (!STMT_VINFO_RELEVANT_P (stmt_info))
continue; continue;
/* For interleaving, only the alignment of the first access /* For interleaving, only the alignment of the first access
......
...@@ -2050,16 +2050,6 @@ vect_slp_analyze_bb_1 (basic_block bb) ...@@ -2050,16 +2050,6 @@ vect_slp_analyze_bb_1 (basic_block bb)
return NULL; 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 /* Check the SLP opportunities in the basic block, analyze and build SLP
trees. */ trees. */
if (!vect_analyze_slp (NULL, bb_vinfo)) if (!vect_analyze_slp (NULL, bb_vinfo))
...@@ -2082,6 +2072,16 @@ vect_slp_analyze_bb_1 (basic_block bb) ...@@ -2082,6 +2072,16 @@ vect_slp_analyze_bb_1 (basic_block bb)
vect_mark_slp_stmts_relevant (SLP_INSTANCE_TREE (instance)); 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_slp_analyze_operations (bb_vinfo))
{ {
if (vect_print_dump_info (REPORT_UNVECTORIZED_LOCATIONS)) if (vect_print_dump_info (REPORT_UNVECTORIZED_LOCATIONS))
......
...@@ -931,6 +931,16 @@ vect_get_store_cost (struct data_reference *dr, int ncopies, ...@@ -931,6 +931,16 @@ vect_get_store_cost (struct data_reference *dr, int ncopies,
break; 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: default:
gcc_unreachable (); gcc_unreachable ();
} }
...@@ -1094,6 +1104,16 @@ vect_get_load_cost (struct data_reference *dr, int ncopies, ...@@ -1094,6 +1104,16 @@ vect_get_load_cost (struct data_reference *dr, int ncopies,
break; 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: default:
gcc_unreachable (); gcc_unreachable ();
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment