Skip to content

Commit 77d7d29

Browse files
committed
tree-optimization/114799 - SLP and patterns
The following plugs a hole with computing whether a SLP node has any pattern stmts which is important to know when we want to replace it by a CTOR from external defs. PR tree-optimization/114799 * tree-vect-slp.cc (vect_get_and_check_slp_defs): Properly update ->any_pattern when swapping operands. * gcc.dg/vect/bb-slp-pr114799.c: New testcase. (cherry picked from commit 18e8e55)
1 parent 1b96649 commit 77d7d29

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

gcc/tree-vect-slp.cc

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -774,6 +774,12 @@ vect_get_and_check_slp_defs (vec_info *vinfo, unsigned char swap,
774774
(*oprnds_info)[i+1]->def_stmts[stmt_num]);
775775
std::swap ((*oprnds_info)[i]->ops[stmt_num],
776776
(*oprnds_info)[i+1]->ops[stmt_num]);
777+
/* After swapping some operands we lost track whether an
778+
operand has any pattern defs so be conservative here. */
779+
if ((*oprnds_info)[i]->any_pattern
780+
|| (*oprnds_info)[i+1]->any_pattern)
781+
(*oprnds_info)[i]->any_pattern
782+
= (*oprnds_info)[i+1]->any_pattern = true;
777783
swapped = true;
778784
continue;
779785
}

0 commit comments

Comments
 (0)