]> git.ipfire.org Git - thirdparty/gcc.git/blobdiff - gcc/tree-vectorizer.h
switch from gimple to gimple*
[thirdparty/gcc.git] / gcc / tree-vectorizer.h
index 95276fa3069f5dd6cd582b86e1cc8ce8b97c54f9..e4d1feb1fc30a47d569dbad75332ce0dab0b259b 100644 (file)
@@ -69,7 +69,7 @@ enum vect_def_type {
 struct stmt_info_for_cost {
   int count;
   enum vect_cost_for_stmt kind;
-  gimple stmt;
+  gimple *stmt;
   int misalign;
 };
 
@@ -78,7 +78,7 @@ typedef vec<stmt_info_for_cost> stmt_vector_for_cost;
 
 static inline void
 add_stmt_info_to_vec (stmt_vector_for_cost *stmt_cost_vec, int count,
-                     enum vect_cost_for_stmt kind, gimple stmt, int misalign)
+                     enum vect_cost_for_stmt kind, gimple *stmt, int misalign)
 {
   stmt_info_for_cost si;
   si.count = count;
@@ -99,12 +99,12 @@ struct _slp_tree {
   /* Nodes that contain def-stmts of this node statements operands.  */
   vec<slp_tree> children;
   /* A group of scalar stmts to be vectorized together.  */
-  vec<gimple> stmts;
+  vec<gimple *> stmts;
   /* Load permutation relative to the stores, NULL if there is no
      permutation.  */
   vec<unsigned> load_permutation;
   /* Vectorized stmt/s.  */
-  vec<gimple> vec_stmts;
+  vec<gimple *> vec_stmts;
   /* Number of vector stmts that are created to replace the group of scalar
      stmts. It is calculated during the transformation phase as the number of
      scalar elements in one scalar iteration (GROUP_SIZE) multiplied by VF
@@ -151,7 +151,7 @@ typedef struct _slp_instance {
 typedef struct _slp_oprnd_info
 {
   /* Def-stmts for the operands.  */
-  vec<gimple> def_stmts;
+  vec<gimple *> def_stmts;
   /* Information about the first statement, its vector def-type, type, the
      operand itself in case it's constant, and an indication if it's a pattern
      stmt.  */
@@ -302,11 +302,11 @@ typedef struct _loop_vec_info {
 
   /* Statements in the loop that have data references that are candidates for a
      runtime (loop versioning) misalignment check.  */
-  vec<gimple> may_misalign_stmts;
+  vec<gimple *> may_misalign_stmts;
 
   /* All interleaving chains of stores in the loop, represented by the first
      stmt in the chain.  */
-  vec<gimple> grouped_stores;
+  vec<gimple *> grouped_stores;
 
   /* All SLP instances in the loop. This is a subset of the set of GROUP_STORES
      of the loop.  */
@@ -317,11 +317,11 @@ typedef struct _loop_vec_info {
   unsigned slp_unrolling_factor;
 
   /* Reduction cycles detected in the loop. Used in loop-aware SLP.  */
-  vec<gimple> reductions;
+  vec<gimple *> reductions;
 
   /* All reduction chains in the loop, represented by the first
      stmt in the chain.  */
-  vec<gimple> reduction_chains;
+  vec<gimple *> reduction_chains;
 
   /* Hash table used to choose the best peeling option.  */
   hash_table<peel_info_hasher> *peeling_htab;
@@ -428,7 +428,7 @@ loop_vec_info_for_loop (struct loop *loop)
 }
 
 static inline bool
-nested_in_vect_loop_p (struct loop *loop, gimple stmt)
+nested_in_vect_loop_p (struct loop *loop, gimple *stmt)
 {
   return (loop->inner
           && (loop->inner == (gimple_bb (stmt))->loop_father));
@@ -439,7 +439,7 @@ typedef struct _bb_vec_info {
   basic_block bb;
   /* All interleaving chains of stores in the basic block, represented by the
      first stmt in the chain.  */
-  vec<gimple> grouped_stores;
+  vec<gimple *> grouped_stores;
 
   /* All SLP instances in the basic block. This is a subset of the set of
      GROUP_STORES of the basic block.  */
@@ -549,7 +549,7 @@ typedef struct _stmt_vec_info {
   bool in_pattern_p;
 
   /* The stmt to which this info struct refers to.  */
-  gimple stmt;
+  gimple *stmt;
 
   /* The loop_vec_info with respect to which STMT is vectorized.  */
   loop_vec_info loop_vinfo;
@@ -558,7 +558,7 @@ typedef struct _stmt_vec_info {
   tree vectype;
 
   /* The vectorized version of the stmt.  */
-  gimple vectorized_stmt;
+  gimple *vectorized_stmt;
 
 
   /** The following is relevant only for stmts that contain a non-scalar
@@ -593,7 +593,7 @@ typedef struct _stmt_vec_info {
         related_stmt of the "pattern stmt" points back to this stmt (which is
         the last stmt in the original sequence of stmts that constitutes the
         pattern).  */
-  gimple related_stmt;
+  gimple *related_stmt;
 
   /* Used to keep a sequence of def stmts of a pattern stmt if such exists.  */
   gimple_seq pattern_def_seq;
@@ -615,12 +615,12 @@ typedef struct _stmt_vec_info {
 
   /* Interleaving and reduction chains info.  */
   /* First element in the group.  */
-  gimple first_element;
+  gimple *first_element;
   /* Pointer to the next element in the group.  */
-  gimple next_element;
+  gimple *next_element;
   /* For data-refs, in case that two or more stmts share data-ref, this is the
      pointer to the previously detected stmt with the same dr.  */
-  gimple same_dr_stmt;
+  gimple *same_dr_stmt;
   /* The size of the group.  */
   unsigned int size;
   /* For stores, number of stores from this group seen. We vectorize the last
@@ -737,7 +737,7 @@ void free_stmt_vec_info_vec (void);
 /* Return a stmt_vec_info corresponding to STMT.  */
 
 static inline stmt_vec_info
-vinfo_for_stmt (gimple stmt)
+vinfo_for_stmt (gimple *stmt)
 {
   unsigned int uid = gimple_uid (stmt);
   if (uid == 0)
@@ -749,7 +749,7 @@ vinfo_for_stmt (gimple stmt)
 /* Set vectorizer information INFO for STMT.  */
 
 static inline void
-set_vinfo_for_stmt (gimple stmt, stmt_vec_info info)
+set_vinfo_for_stmt (gimple *stmt, stmt_vec_info info)
 {
   unsigned int uid = gimple_uid (stmt);
   if (uid == 0)
@@ -765,8 +765,8 @@ set_vinfo_for_stmt (gimple stmt, stmt_vec_info info)
 
 /* Return the earlier statement between STMT1 and STMT2.  */
 
-static inline gimple
-get_earlier_stmt (gimple stmt1, gimple stmt2)
+static inline gimple *
+get_earlier_stmt (gimple *stmt1, gimple *stmt2)
 {
   unsigned int uid1, uid2;
 
@@ -793,8 +793,8 @@ get_earlier_stmt (gimple stmt1, gimple stmt2)
 
 /* Return the later statement between STMT1 and STMT2.  */
 
-static inline gimple
-get_later_stmt (gimple stmt1, gimple stmt2)
+static inline gimple *
+get_later_stmt (gimple *stmt1, gimple *stmt2)
 {
   unsigned int uid1, uid2;
 
@@ -825,7 +825,7 @@ get_later_stmt (gimple stmt1, gimple stmt2)
 static inline bool
 is_pattern_stmt_p (stmt_vec_info stmt_info)
 {
-  gimple related_stmt;
+  gimple *related_stmt;
   stmt_vec_info related_stmt_info;
 
   related_stmt = STMT_VINFO_RELATED_STMT (stmt_info);
@@ -996,21 +996,22 @@ extern bool vect_can_advance_ivs_p (loop_vec_info);
 extern unsigned int current_vector_size;
 extern tree get_vectype_for_scalar_type (tree);
 extern tree get_same_sized_vectype (tree, tree);
-extern bool vect_is_simple_use (tree, gimple, loop_vec_info,
-                               bb_vec_info, gimple *,
+extern bool vect_is_simple_use (tree, gimple *, loop_vec_info,
+                               bb_vec_info, gimple **,
                                 tree *,  enum vect_def_type *);
-extern bool vect_is_simple_use_1 (tree, gimple, loop_vec_info,
-                                 bb_vec_info, gimple *,
+extern bool vect_is_simple_use_1 (tree, gimple *, loop_vec_info,
+                                 bb_vec_info, gimple **,
                                  tree *,  enum vect_def_type *, tree *);
-extern bool supportable_widening_operation (enum tree_code, gimple, tree, tree,
-                                            enum tree_code *, enum tree_code *,
-                                           int *, vec<tree> *);
+extern bool supportable_widening_operation (enum tree_code, gimple *, tree,
+                                           tree, enum tree_code *,
+                                           enum tree_code *, int *,
+                                           vec<tree> *);
 extern bool supportable_narrowing_operation (enum tree_code, tree, tree,
                                             enum tree_code *,
                                             int *, vec<tree> *);
-extern stmt_vec_info new_stmt_vec_info (gimple stmt, loop_vec_info,
+extern stmt_vec_info new_stmt_vec_info (gimple *stmt, loop_vec_info,
                                         bb_vec_info);
-extern void free_stmt_vec_info (gimple stmt);
+extern void free_stmt_vec_info (gimple *stmt);
 extern tree vectorizable_function (gcall *, tree, tree);
 extern void vect_model_simple_cost (stmt_vec_info, int, enum vect_def_type *,
                                     stmt_vector_for_cost *,
@@ -1025,19 +1026,19 @@ extern void vect_model_load_cost (stmt_vec_info, int, bool, slp_tree,
 extern unsigned record_stmt_cost (stmt_vector_for_cost *, int,
                                  enum vect_cost_for_stmt, stmt_vec_info,
                                  int, enum vect_cost_model_location);
-extern void vect_finish_stmt_generation (gimple, gimple,
+extern void vect_finish_stmt_generation (gimple *, gimple *,
                                          gimple_stmt_iterator *);
 extern bool vect_mark_stmts_to_be_vectorized (loop_vec_info);
-extern tree vect_get_vec_def_for_operand (tree, gimple, tree *);
-extern tree vect_init_vector (gimple, tree, tree,
+extern tree vect_get_vec_def_for_operand (tree, gimple *, tree *);
+extern tree vect_init_vector (gimple *, tree, tree,
                               gimple_stmt_iterator *);
 extern tree vect_get_vec_def_for_stmt_copy (enum vect_def_type, tree);
-extern bool vect_transform_stmt (gimple, gimple_stmt_iterator *,
+extern bool vect_transform_stmt (gimple *, gimple_stmt_iterator *,
                                  bool *, slp_tree, slp_instance);
-extern void vect_remove_stores (gimple);
-extern bool vect_analyze_stmt (gimple, bool *, slp_tree);
-extern bool vectorizable_condition (gimple, gimple_stmt_iterator *, gimple *,
-                                    tree, int, slp_tree);
+extern void vect_remove_stores (gimple *);
+extern bool vect_analyze_stmt (gimple *, bool *, slp_tree);
+extern bool vectorizable_condition (gimple *, gimple_stmt_iterator *,
+                                   gimple **, tree, int, slp_tree);
 extern void vect_get_load_cost (struct data_reference *, int, bool,
                                unsigned int *, unsigned int *,
                                stmt_vector_for_cost *,
@@ -1045,7 +1046,7 @@ extern void vect_get_load_cost (struct data_reference *, int, bool,
 extern void vect_get_store_cost (struct data_reference *, int,
                                 unsigned int *, stmt_vector_for_cost *);
 extern bool vect_supportable_shift (enum tree_code, tree);
-extern void vect_get_vec_defs (tree, tree, gimple, vec<tree> *,
+extern void vect_get_vec_defs (tree, tree, gimple *, vec<tree> *,
                               vec<tree> *, slp_tree, int);
 extern tree vect_gen_perm_mask_any (tree, const unsigned char *);
 extern tree vect_gen_perm_mask_checked (tree, const unsigned char *);
@@ -1054,7 +1055,7 @@ extern tree vect_gen_perm_mask_checked (tree, const unsigned char *);
 extern bool vect_can_force_dr_alignment_p (const_tree, unsigned int);
 extern enum dr_alignment_support vect_supportable_dr_alignment
                                            (struct data_reference *, bool);
-extern tree vect_get_smallest_scalar_type (gimple, HOST_WIDE_INT *,
+extern tree vect_get_smallest_scalar_type (gimple *, HOST_WIDE_INT *,
                                            HOST_WIDE_INT *);
 extern bool vect_analyze_data_ref_dependences (loop_vec_info, int *);
 extern bool vect_slp_analyze_data_ref_dependences (bb_vec_info);
@@ -1063,49 +1064,50 @@ extern bool vect_analyze_data_refs_alignment (loop_vec_info, bb_vec_info);
 extern bool vect_verify_datarefs_alignment (loop_vec_info, bb_vec_info);
 extern bool vect_analyze_data_ref_accesses (loop_vec_info, bb_vec_info);
 extern bool vect_prune_runtime_alias_test_list (loop_vec_info);
-extern tree vect_check_gather_scatter (gimple, loop_vec_info, tree *, tree *,
+extern tree vect_check_gather_scatter (gimple *, loop_vec_info, tree *, tree *,
                                       int *);
 extern bool vect_analyze_data_refs (loop_vec_info, bb_vec_info, int *,
                                    unsigned *);
-extern tree vect_create_data_ref_ptr (gimple, tree, struct loop *, tree,
+extern tree vect_create_data_ref_ptr (gimple *, tree, struct loop *, tree,
                                      tree *, gimple_stmt_iterator *,
-                                     gimple *, bool, bool *,
+                                     gimple **, bool, bool *,
                                      tree = NULL_TREE);
-extern tree bump_vector_ptr (tree, gimple, gimple_stmt_iterator *, gimple, tree);
+extern tree bump_vector_ptr (tree, gimple *, gimple_stmt_iterator *, gimple *,
+                            tree);
 extern tree vect_create_destination_var (tree, tree);
 extern bool vect_grouped_store_supported (tree, unsigned HOST_WIDE_INT);
 extern bool vect_store_lanes_supported (tree, unsigned HOST_WIDE_INT);
 extern bool vect_grouped_load_supported (tree, unsigned HOST_WIDE_INT);
 extern bool vect_load_lanes_supported (tree, unsigned HOST_WIDE_INT);
-extern void vect_permute_store_chain (vec<tree> ,unsigned int, gimple,
+extern void vect_permute_store_chain (vec<tree> ,unsigned int, gimple *,
                                     gimple_stmt_iterator *, vec<tree> *);
-extern tree vect_setup_realignment (gimple, gimple_stmt_iterator *, tree *,
+extern tree vect_setup_realignment (gimple *, gimple_stmt_iterator *, tree *,
                                     enum dr_alignment_support, tree,
                                     struct loop **);
-extern void vect_transform_grouped_load (gimple, vec<tree> , int,
+extern void vect_transform_grouped_load (gimple *, vec<tree> , int,
                                          gimple_stmt_iterator *);
-extern void vect_record_grouped_load_vectors (gimple, vec<tree> );
+extern void vect_record_grouped_load_vectors (gimple *, vec<tree> );
 extern tree vect_get_new_vect_var (tree, enum vect_var_kind, const char *);
-extern tree vect_create_addr_base_for_vector_ref (gimple, gimple_seq *,
+extern tree vect_create_addr_base_for_vector_ref (gimple *, gimple_seq *,
                                                  tree, struct loop *,
                                                  tree = NULL_TREE);
 
 /* In tree-vect-loop.c.  */
 /* FORNOW: Used in tree-parloops.c.  */
 extern void destroy_loop_vec_info (loop_vec_info, bool);
-extern gimple vect_force_simple_reduction (loop_vec_info, gimple, bool, bool *,
-                                          bool);
+extern gimple *vect_force_simple_reduction (loop_vec_info, gimple *, bool,
+                                           bool *, bool);
 /* Drive for loop analysis stage.  */
 extern loop_vec_info vect_analyze_loop (struct loop *);
 /* Drive for loop transformation stage.  */
 extern void vect_transform_loop (loop_vec_info);
 extern loop_vec_info vect_analyze_loop_form (struct loop *);
-extern bool vectorizable_live_operation (gimple, gimple_stmt_iterator *,
-                                         gimple *);
-extern bool vectorizable_reduction (gimple, gimple_stmt_iterator *, gimple *,
-                                    slp_tree);
-extern bool vectorizable_induction (gimple, gimple_stmt_iterator *, gimple *);
-extern tree get_initial_def_for_reduction (gimple, tree, tree *);
+extern bool vectorizable_live_operation (gimple *, gimple_stmt_iterator *,
+                                        gimple **);
+extern bool vectorizable_reduction (gimple *, gimple_stmt_iterator *,
+                                   gimple **, slp_tree);
+extern bool vectorizable_induction (gimple *, gimple_stmt_iterator *, gimple **);
+extern tree get_initial_def_for_reduction (gimple *, tree, tree *);
 extern int vect_min_worthwhile_factor (enum tree_code);
 extern int vect_get_known_peeling_cost (loop_vec_info, int, int *,
                                        stmt_vector_for_cost *,
@@ -1134,7 +1136,7 @@ extern void vect_slp_transform_bb (basic_block);
 /* Pattern recognition functions.
    Additional pattern recognition functions can (and will) be added
    in the future.  */
-typedef gimple (* vect_recog_func_ptr) (vec<gimple> *, tree *, tree *);
+typedef gimple *(* vect_recog_func_ptr) (vec<gimple *> *, tree *, tree *);
 #define NUM_PATTERNS 13
 void vect_pattern_recog (loop_vec_info, bb_vec_info);