diff options
author | Richard Biener <rguenther@suse.de> | 2019-10-25 12:25:52 +0000 |
---|---|---|
committer | Richard Biener <rguenth@gcc.gnu.org> | 2019-10-25 12:25:52 +0000 |
commit | 77100812a3bf4c693cb24c65be54ea367f17a246 (patch) | |
tree | c408c3a88e80fd881b0f49b0c5455e9d91384d86 | |
parent | bafe6f6a45e804efbf801ab2a8b4065934d11078 (diff) | |
download | gcc-77100812a3bf4c693cb24c65be54ea367f17a246.zip gcc-77100812a3bf4c693cb24c65be54ea367f17a246.tar.gz gcc-77100812a3bf4c693cb24c65be54ea367f17a246.tar.bz2 |
tree-vect-slp.c (vect_get_and_check_slp_defs): Only fail swapping if we actually have to modify the IL on a shared stmt.
2019-10-25 Richard Biener <rguenther@suse.de>
* tree-vect-slp.c (vect_get_and_check_slp_defs): Only fail
swapping if we actually have to modify the IL on a shared stmt.
(vect_build_slp_tree_2): Never fail swapping on shared stmts
because we no longer modify the IL.
From-SVN: r277446
-rw-r--r-- | gcc/ChangeLog | 7 | ||||
-rw-r--r-- | gcc/tree-vect-slp.c | 44 |
2 files changed, 18 insertions, 33 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 3601030..8762756 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,10 @@ +2019-10-25 Richard Biener <rguenther@suse.de> + + * tree-vect-slp.c (vect_get_and_check_slp_defs): Only fail + swapping if we actually have to modify the IL on a shared stmt. + (vect_build_slp_tree_2): Never fail swapping on shared stmts + because we no longer modify the IL. + 2019-10-25 Martin Liska <mliska@suse.cz> * tree.c (dump_tree_statistics): Use sorted index 'j' and not 'i'. diff --git a/gcc/tree-vect-slp.c b/gcc/tree-vect-slp.c index 3db08fa..f367595 100644 --- a/gcc/tree-vect-slp.c +++ b/gcc/tree-vect-slp.c @@ -537,19 +537,19 @@ again: /* Swap operands. */ if (swapped) { - /* If there are already uses of this stmt in a SLP instance then - we've committed to the operand order and can't swap it. */ - if (STMT_VINFO_NUM_SLP_USES (stmt_info) != 0) - { - if (dump_enabled_p ()) - dump_printf_loc (MSG_MISSED_OPTIMIZATION, vect_location, - "Build SLP failed: cannot swap operands of " - "shared stmt %G", stmt_info->stmt); - return -1; - } - if (first_op_cond) { + /* If there are already uses of this stmt in a SLP instance then + we've committed to the operand order and can't swap it. */ + if (STMT_VINFO_NUM_SLP_USES (stmt_info) != 0) + { + if (dump_enabled_p ()) + dump_printf_loc (MSG_MISSED_OPTIMIZATION, vect_location, + "Build SLP failed: cannot swap operands of " + "shared stmt %G", stmt_info->stmt); + return -1; + } + /* To get rid of this swapping we have to move the stmt code to the SLP tree as well (and gather it here per stmt). */ gassign *stmt = as_a <gassign *> (stmt_info->stmt); @@ -1413,28 +1413,6 @@ vect_build_slp_tree_2 (vec_info *vinfo, swap_not_matching = false; break; } - /* Verify if we can safely swap or if we committed to a - specific operand order already. - ??? Instead of modifying GIMPLE stmts here we could - record whether we want to swap operands in the SLP - node and temporarily do that when processing it - (or wrap operand accessors in a helper). */ - else if (swap[j] != 0 - || STMT_VINFO_NUM_SLP_USES (stmt_info)) - { - if (!swap_not_matching) - { - if (dump_enabled_p ()) - dump_printf_loc (MSG_MISSED_OPTIMIZATION, - vect_location, - "Build SLP failed: cannot swap " - "operands of shared stmt %G", - stmts[j]->stmt); - goto fail; - } - swap_not_matching = false; - break; - } } } while (j != group_size); |