this->max_nunits = 1;
this->lanes = 0;
SLP_TREE_TYPE (this) = undef_vec_info_type;
- this->u.undef = NULL;
+ this->data = NULL;
}
/* Tear down a SLP node. */
SLP_TREE_SIMD_CLONE_INFO (this).release ();
if (this->failed)
free (failed);
+ if (this->data)
+ delete this->data;
}
/* Push the single SSA definition in DEF to the vector of vector defs. */
typedef vec<unsigned> load_permutation_t;
typedef auto_vec<unsigned, 16> auto_load_permutation_t;
+struct vect_data {
+ virtual ~vect_data () = default;
+};
+
/* A computation tree of an SLP instance. Each node corresponds to a group of
stmts to be packed in a SIMD stmt. */
struct _slp_tree {
for loop vectorization. */
vect_memory_access_type memory_access_type;
- /* The kind of operation as determined by analysis and a tagged
- union with kind specific data. */
+ /* The kind of operation as determined by analysis and optional
+ kind specific data. */
enum stmt_vec_info_type type;
- union {
- void *undef;
- } u;
+ vect_data *data;
+
+ template <class T>
+ T& get_data (T& else_) { return data ? *static_cast <T *> (data) : else_; }
/* If not NULL this is a cached failed SLP discovery attempt with
the lanes that failed during SLP discovery as 'false'. This is