[2/2] tree-optimization/124802 - avoid SLP_TREE_REPRESENTATIVE for permutes
Commit Message
The following avoids having a SLP_TREE_REPRESENTATIVE for permute
nodes from two operator SLP matching.
Bootstrap and regtest running on x86_64-unknown-linux-gnu.
And this I plan to push for stage1.
PR tree-optimization/124802
* tree-vect-slp.cc (vect_build_slp_tree_2): Reset
SLP_TREE_REPRESENTATIVE for permute nodes built from
a known set of scalar stmts.
---
gcc/tree-vect-slp.cc | 2 ++
1 file changed, 2 insertions(+)
@@ -3137,6 +3137,7 @@ fail:
SLP_TREE_VECTYPE (pnode) = vectype;
SLP_TREE_CHILDREN (pnode).quick_push (child);
SLP_TREE_CHILDREN (pnode).quick_push (child);
+ SLP_TREE_REPRESENTATIVE (pnode) = NULL;
lane_permutation_t& perm = SLP_TREE_LANE_PERMUTATION (pnode);
children.safe_push (pnode);
@@ -3166,6 +3167,7 @@ fail:
SLP_TREE_CODE (node) = VEC_PERM_EXPR;
SLP_TREE_CHILDREN (node).quick_push (one);
SLP_TREE_CHILDREN (node).quick_push (two);
+ SLP_TREE_REPRESENTATIVE (node) = NULL;
enum tree_code code0 = ERROR_MARK;
enum tree_code ocode = ERROR_MARK;
if (gassign *stmt = dyn_cast <gassign *> (stmts[0]->stmt))