OSDN Git Service

* lib/target-supports.exp
[pf3gnuchains/gcc-fork.git] / gcc / tree-vect-patterns.c
index d5bff5a..1971e6a 100644 (file)
@@ -1,5 +1,5 @@
 /* Analysis Utilities for Loop Vectorization.
-   Copyright (C) 2006, 2007, 2008 Free Software Foundation, Inc.
+   Copyright (C) 2006, 2007, 2008, 2009 Free Software Foundation, Inc.
    Contributed by Dorit Nuzman <dorit@il.ibm.com>
 
 This file is part of GCC.
@@ -24,13 +24,11 @@ along with GCC; see the file COPYING3.  If not see
 #include "tm.h"
 #include "ggc.h"
 #include "tree.h"
-
 #include "target.h"
 #include "basic-block.h"
 #include "diagnostic.h"
 #include "tree-flow.h"
 #include "tree-dump.h"
-#include "timevar.h"
 #include "cfgloop.h"
 #include "expr.h"
 #include "optabs.h"
@@ -80,11 +78,11 @@ widened_name_p (tree name, gimple use_stmt, tree *half_type, gimple *def_stmt)
   stmt_vinfo = vinfo_for_stmt (use_stmt);
   loop_vinfo = STMT_VINFO_LOOP_VINFO (stmt_vinfo);
 
-  if (!vect_is_simple_use (name, loop_vinfo, def_stmt, &def, &dt))
+  if (!vect_is_simple_use (name, loop_vinfo, NULL, def_stmt, &def, &dt))
     return false;
 
-  if (dt != vect_loop_def
-      && dt != vect_invariant_def && dt != vect_constant_def)
+  if (dt != vect_internal_def
+      && dt != vect_external_def && dt != vect_constant_def)
     return false;
 
   if (! *def_stmt)
@@ -104,7 +102,8 @@ widened_name_p (tree name, gimple use_stmt, tree *half_type, gimple *def_stmt)
       || (TYPE_PRECISION (type) < (TYPE_PRECISION (*half_type) * 2)))
     return false;
 
-  if (!vect_is_simple_use (oprnd0, loop_vinfo, &dummy_gimple, &dummy, &dt))
+  if (!vect_is_simple_use (oprnd0, loop_vinfo, NULL, &dummy_gimple, &dummy, 
+                           &dt))
     return false;
 
   return true;
@@ -261,7 +260,7 @@ vect_recog_dot_prod_pattern (gimple last_stmt, tree *type_in, tree *type_out)
     return NULL; 
   stmt_vinfo = vinfo_for_stmt (stmt);
   gcc_assert (stmt_vinfo);
-  if (STMT_VINFO_DEF_TYPE (stmt_vinfo) != vect_loop_def)
+  if (STMT_VINFO_DEF_TYPE (stmt_vinfo) != vect_internal_def)
     return NULL;
   if (gimple_assign_rhs_code (stmt) != MULT_EXPR)
     return NULL;
@@ -274,7 +273,7 @@ vect_recog_dot_prod_pattern (gimple last_stmt, tree *type_in, tree *type_out)
         return NULL;
       stmt_vinfo = vinfo_for_stmt (stmt);
       gcc_assert (stmt_vinfo);
-      gcc_assert (STMT_VINFO_DEF_TYPE (stmt_vinfo) == vect_loop_def);
+      gcc_assert (STMT_VINFO_DEF_TYPE (stmt_vinfo) == vect_internal_def);
       oprnd00 = gimple_assign_rhs1 (stmt);
       oprnd01 = gimple_assign_rhs2 (stmt);
     }
@@ -320,12 +319,7 @@ vect_recog_dot_prod_pattern (gimple last_stmt, tree *type_in, tree *type_out)
 
   /* We don't allow changing the order of the computation in the inner-loop
      when doing outer-loop vectorization.  */
-  if (nested_in_vect_loop_p (loop, last_stmt))
-    {
-      if (vect_print_dump_info (REPORT_DETAILS))
-        fprintf (vect_dump, "vect_recog_dot_prod_pattern: not allowed.");
-      return NULL;
-    }
+  gcc_assert (!nested_in_vect_loop_p (loop, last_stmt));
 
   return pattern_stmt;
 }
@@ -374,7 +368,8 @@ vect_recog_widen_mult_pattern (gimple last_stmt,
   tree dummy;
   tree var;
   enum tree_code dummy_code;
-  bool dummy_bool;
+  int dummy_int;
+  VEC (tree, heap) *dummy_vec;
 
   if (!is_gimple_assign (last_stmt))
     return NULL;
@@ -415,7 +410,7 @@ vect_recog_widen_mult_pattern (gimple last_stmt,
   if (!vectype
       || !supportable_widening_operation (WIDEN_MULT_EXPR, last_stmt, vectype,
                                          &dummy, &dummy, &dummy_code,
-                                         &dummy_code, &dummy_bool, &dummy))
+                                         &dummy_code, &dummy_int, &dummy_vec))
     return NULL;
 
   *type_in = vectype;
@@ -638,12 +633,7 @@ vect_recog_widen_sum_pattern (gimple last_stmt, tree *type_in, tree *type_out)
 
   /* We don't allow changing the order of the computation in the inner-loop
      when doing outer-loop vectorization.  */
-  if (nested_in_vect_loop_p (loop, last_stmt))
-    {
-      if (vect_print_dump_info (REPORT_DETAILS))
-        fprintf (vect_dump, "vect_recog_widen_sum_pattern: not allowed.");
-      return NULL;
-    }
+  gcc_assert (!nested_in_vect_loop_p (loop, last_stmt));
 
   return pattern_stmt;
 }
@@ -696,7 +686,7 @@ vect_pattern_recog_1 (
     }
   else
     {
-      enum tree_code vec_mode;
+      enum machine_mode vec_mode;
       enum insn_code icode;
       optab optab;
 
@@ -735,7 +725,7 @@ vect_pattern_recog_1 (
   /* Mark the stmts that are involved in the pattern. */
   gsi_insert_before (&si, pattern_stmt, GSI_SAME_STMT);
   set_vinfo_for_stmt (pattern_stmt,
-                     new_stmt_vec_info (pattern_stmt, loop_vinfo));
+                     new_stmt_vec_info (pattern_stmt, loop_vinfo, NULL));
   pattern_stmt_info = vinfo_for_stmt (pattern_stmt);
   
   STMT_VINFO_RELATED_STMT (pattern_stmt_info) = stmt;