------- Comment #4 from spop at gcc dot gnu dot org  2010-03-26 20:49 -------
This cleanup of vectorizable_condition allows this testcase to be vectorized:

typedef int uint8_t;
vsad16_c (void *c, uint8_t * s1, uint8_t * s2, int stride, int h)
{
  int score = 0;
  int x, y;
  for (x = 0; x < 16; x++)
    score += ((s1[x] - s1[x + stride] + s2[x + stride]) >= 0 ?
              s1[x] + s2[x + stride] :
              s2[x + stride]);
  return score;
}


diff --git a/gcc/tree-vect-stmts.c b/gcc/tree-vect-stmts.c
index 4bce61a..cfb1471 100644
--- a/gcc/tree-vect-stmts.c
+++ b/gcc/tree-vect-stmts.c
@@ -3865,7 +3865,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 (!useless_type_conversion_p (TREE_TYPE (TREE_OPERAND (cond_expr, 0)),
+                                 TREE_TYPE (vectype)))
     return false;

   if (TREE_CODE (then_clause) == SSA_NAME)


-- 


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=43430

Reply via email to