@@ -5169,7 +5169,7 @@ const unsigned int NUM_PATTERNS = ARRAY_SIZE (vect_vect_recog_func_ptrs);
/* Mark statements that are involved in a pattern. */
-static inline void
+void
vect_mark_pattern_stmts (vec_info *vinfo,
stmt_vec_info orig_stmt_info, gimple *pattern_stmt,
tree pattern_vectype)
@@ -86,7 +86,7 @@ _slp_tree::~_slp_tree ()
/* Recursively free the memory allocated for the SLP tree rooted at NODE. */
-static void
+void
vect_free_slp_tree (slp_tree node)
{
int i;
@@ -1120,45 +1120,6 @@ vect_build_slp_tree_1 (vec_info *vinfo, unsigned char *swap,
return true;
}
-/* Traits for the hash_set to record failed SLP builds for a stmt set.
- Note we never remove apart from at destruction time so we do not
- need a special value for deleted that differs from empty. */
-struct bst_traits
-{
- typedef vec <stmt_vec_info> value_type;
- typedef vec <stmt_vec_info> compare_type;
- static inline hashval_t hash (value_type);
- static inline bool equal (value_type existing, value_type candidate);
- static inline bool is_empty (value_type x) { return !x.exists (); }
- static inline bool is_deleted (value_type x) { return !x.exists (); }
- static const bool empty_zero_p = true;
- static inline void mark_empty (value_type &x) { x.release (); }
- static inline void mark_deleted (value_type &x) { x.release (); }
- static inline void remove (value_type &x) { x.release (); }
-};
-inline hashval_t
-bst_traits::hash (value_type x)
-{
- inchash::hash h;
- for (unsigned i = 0; i < x.length (); ++i)
- h.add_int (gimple_uid (x[i]->stmt));
- return h.end ();
-}
-inline bool
-bst_traits::equal (value_type existing, value_type candidate)
-{
- if (existing.length () != candidate.length ())
- return false;
- for (unsigned i = 0; i < existing.length (); ++i)
- if (existing[i] != candidate[i])
- return false;
- return true;
-}
-
-typedef hash_map <vec <gimple *>, slp_tree,
- simple_hashmap_traits <bst_traits, slp_tree> >
- scalar_stmts_to_slp_tree_map_t;
-
static slp_tree
vect_build_slp_tree_2 (vec_info *vinfo,
vec<stmt_vec_info> stmts, unsigned int group_size,
@@ -1166,7 +1127,7 @@ vect_build_slp_tree_2 (vec_info *vinfo,
bool *matches, unsigned *npermutes, unsigned *tree_size,
scalar_stmts_to_slp_tree_map_t *bst_map);
-static slp_tree
+slp_tree
vect_build_slp_tree (vec_info *vinfo,
vec<stmt_vec_info> stmts, unsigned int group_size,
poly_uint64 *max_nunits,
@@ -2047,6 +2047,9 @@ extern int vect_get_place_in_interleaving_chain (stmt_vec_info, stmt_vec_info);
extern bool vect_update_shared_vectype (stmt_vec_info, tree);
/* In tree-vect-patterns.c. */
+extern void
+vect_mark_pattern_stmts (vec_info *, stmt_vec_info, gimple *, tree);
+
/* Pattern recognition functions.
Additional pattern recognition functions can (and will) be added
in the future. */
@@ -2058,4 +2061,51 @@ void vect_free_loop_info_assumptions (class loop *);
gimple *vect_loop_vectorized_call (class loop *, gcond **cond = NULL);
bool vect_stmt_dominates_stmt_p (gimple *, gimple *);
+/* Traits for the hash_set to record failed SLP builds for a stmt set.
+ Note we never remove apart from at destruction time so we do not
+ need a special value for deleted that differs from empty. */
+struct bst_traits
+{
+ typedef vec <stmt_vec_info> value_type;
+ typedef vec <stmt_vec_info> compare_type;
+ static inline hashval_t hash (value_type);
+ static inline bool equal (value_type existing, value_type candidate);
+ static inline bool is_empty (value_type x) { return !x.exists (); }
+ static inline bool is_deleted (value_type x) { return !x.exists (); }
+ static const bool empty_zero_p = true;
+ static inline void mark_empty (value_type &x) { x.release (); }
+ static inline void mark_deleted (value_type &x) { x.release (); }
+ static inline void remove (value_type &x) { x.release (); }
+};
+inline hashval_t
+bst_traits::hash (value_type x)
+{
+ inchash::hash h;
+ for (unsigned i = 0; i < x.length (); ++i)
+ h.add_int (gimple_uid (x[i]->stmt));
+ return h.end ();
+}
+inline bool
+bst_traits::equal (value_type existing, value_type candidate)
+{
+ if (existing.length () != candidate.length ())
+ return false;
+ for (unsigned i = 0; i < existing.length (); ++i)
+ if (existing[i] != candidate[i])
+ return false;
+ return true;
+}
+
+typedef hash_map <vec <gimple *>, slp_tree,
+ simple_hashmap_traits <bst_traits, slp_tree> >
+ scalar_stmts_to_slp_tree_map_t;
+
+extern void
+vect_free_slp_tree (slp_tree node);
+
+slp_tree
+vect_build_slp_tree (vec_info *, vec<stmt_vec_info>, unsigned int,
+ poly_uint64 *, bool *, unsigned *, unsigned *,
+ scalar_stmts_to_slp_tree_map_t *);
+
#endif /* GCC_TREE_VECTORIZER_H */