Commit 8533c9d8 by Sebastian Pop Committed by Sebastian Pop

Replace type != type comparisons with types_compatible_p.

2010-03-30  Sebastian Pop  <sebastian.pop@amd.com>

	PR middle-end/43430
	* tree-vect-slp.c (vect_get_and_check_slp_defs): Replace type
	pointer comparisons with types_compatible_p.
	* tree-vect-stmts.c (vectorizable_call): Same.
	(vectorizable_condition): Same.

	* gcc.dg/vect/pr43430-1.c: New.

From-SVN: r157833
parent ce0ecb98
2010-03-30 Sebastian Pop <sebastian.pop@amd.com>
PR middle-end/43430
* tree-vect-slp.c (vect_get_and_check_slp_defs): Replace type
pointer comparisons with types_compatible_p.
* tree-vect-stmts.c (vectorizable_call): Same.
(vectorizable_condition): Same.
2010-03-30 Andreas Krebbel <Andreas.Krebbel@de.ibm.com>
* config/s390/s390.c (s390_emit_prologue): Omit issuing a dynamic
......
2010-03-30 Sebastian Pop <sebastian.pop@amd.com>
PR middle-end/43430
* gcc.dg/vect/pr43430-1.c: New.
2010-03-30 Jason Merrill <jason@redhat.com>
PR c++/43559
......
/* { dg-require-effective-target vect_int } */
#include <stdarg.h>
#include "tree-vect.h"
#define N 16
typedef int uint8_t;
uint8_t data_ch1[N + 1] =
{ 0, 2, 4, 6, 8, 10, 12, 14, 16, 18, 20, 22, 24, 26, 28, 30 };
uint8_t data_ch2[N + 1] =
{ 0, 2, 4, 6, 8, 10, 12, 14, 16, 18, 20, 22, 24, 26, 28, 30 };
#define SUM 480
__attribute__ ((noinline)) int
foo (uint8_t * s1, uint8_t * s2, int stride)
{
int score = 0;
int x;
for (x = 0; x < N; x++)
score += ((s1[x] - s1[x + stride] + s2[x + stride]) >= 0 ?
s1[x] + s2[x + stride] :
s2[x + stride]);
if (score != SUM)
abort ();
return 0;
}
int
main (void)
{
check_vect ();
return foo (data_ch1, data_ch2, 1);
}
/* { dg-final { scan-tree-dump-times "vectorized 1 loops" 1 "vect" } } */
/* { dg-final { cleanup-tree-dump "vect" } } */
......@@ -246,14 +246,16 @@ vect_get_and_check_slp_defs (loop_vec_info loop_vinfo, bb_vec_info bb_vinfo,
if ((i == 0
&& (*first_stmt_dt0 != dt[i]
|| (*first_stmt_def0_type && def
&& *first_stmt_def0_type != TREE_TYPE (def))))
&& !types_compatible_p (*first_stmt_def0_type,
TREE_TYPE (def)))))
|| (i == 1
&& (*first_stmt_dt1 != dt[i]
|| (*first_stmt_def1_type && def
&& *first_stmt_def1_type != TREE_TYPE (def))))
&& !types_compatible_p (*first_stmt_def1_type,
TREE_TYPE (def)))))
|| (!def
&& TREE_TYPE (*first_stmt_const_oprnd)
!= TREE_TYPE (oprnd)))
&& !types_compatible_p (TREE_TYPE (*first_stmt_const_oprnd),
TREE_TYPE (oprnd))))
{
if (vect_print_dump_info (REPORT_SLP))
fprintf (vect_dump, "Build SLP failed: different types ");
......
......@@ -1268,7 +1268,7 @@ vectorizable_call (gimple stmt, gimple_stmt_iterator *gsi, gimple *vec_stmt)
/* We can only handle calls with arguments of the same type. */
if (rhs_type
&& rhs_type != TREE_TYPE (op))
&& !types_compatible_p (rhs_type, TREE_TYPE (op)))
{
if (vect_print_dump_info (REPORT_DETAILS))
fprintf (vect_dump, "argument types differ.");
......@@ -3863,7 +3863,8 @@ vectorizable_condition (gimple stmt, gimple_stmt_iterator *gsi,
/* We do not handle two different vector types for the condition
and the values. */
if (TREE_TYPE (TREE_OPERAND (cond_expr, 0)) != TREE_TYPE (vectype))
if (!types_compatible_p (TREE_TYPE (TREE_OPERAND (cond_expr, 0)),
TREE_TYPE (vectype)))
return false;
if (TREE_CODE (then_clause) == SSA_NAME)
......
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