void build (vec_info *);
static internal_fn
- matches (complex_operation_t op, slp_tree_to_load_perm_map_t *,
+ matches (complex_operation_t op, slp_tree_to_load_perm_map_t *, slp_tree *,
vec<slp_tree> *);
};
public:
void build (vec_info *);
static internal_fn
- matches (complex_operation_t op, slp_tree_to_load_perm_map_t *,
+ matches (complex_operation_t op, slp_tree_to_load_perm_map_t *, slp_tree *,
vec<slp_tree> *);
static vect_pattern*
recognize (slp_tree_to_load_perm_map_t *, slp_tree *);
+
+ static vect_pattern*
+ mkInstance (slp_tree *node, vec<slp_tree> *m_ops, internal_fn ifn)
+ {
+ return new complex_add_pattern (node, m_ops, ifn);
+ }
};
/* Perform a replacement of the detected complex add pattern with the new
nodes.quick_push (children[0]);
nodes.quick_push (vect_build_swap_evenodd_node (children[1]));
+ SLP_TREE_REF_COUNT (nodes[0])++;
+ SLP_TREE_REF_COUNT (nodes[1])++;
+ vect_free_slp_tree (this->m_ops[0]);
+ vect_free_slp_tree (this->m_ops[1]);
+
SLP_TREE_CHILDREN (*this->m_node).truncate (0);
SLP_TREE_CHILDREN (*this->m_node).safe_splice (nodes);
internal_fn
complex_add_pattern::matches (complex_operation_t op,
slp_tree_to_load_perm_map_t *perm_cache,
- vec<slp_tree> *ops)
+ slp_tree *node, vec<slp_tree> *ops)
{
internal_fn ifn = IFN_LAST;
if (linear_loads_p (perm_cache, children[1]).first != PERM_ODDEVEN)
return IFN_LAST;
+ if (!vect_pattern_validate_optab (ifn, *node))
+ return IFN_LAST;
+
return ifn;
}
auto_vec<slp_tree> ops;
complex_operation_t op
= vect_detect_pair_op (*node, true, &ops);
- internal_fn ifn = complex_add_pattern::matches (op, perm_cache, &ops);
- if (!vect_pattern_validate_optab (ifn, *node))
+ internal_fn ifn
+ = complex_add_pattern::matches (op, perm_cache, node, &ops);
+ if (ifn == IFN_LAST)
return NULL;
return new complex_add_pattern (node, &ops, ifn);