aboutsummaryrefslogtreecommitdiff
path: root/gcc
diff options
context:
space:
mode:
authorRichard Biener <rguenther@suse.de>2025-01-30 14:52:14 +0100
committerRichard Biener <rguenth@gcc.gnu.org>2025-01-31 09:11:04 +0100
commit9e3ceed8d50912e271e84389ed80aeea47184e59 (patch)
treee5de8789df7ca14f12cdbaff35f2f579c1f910b9 /gcc
parentc8cc686377f63f39c188661d6283637188046b48 (diff)
downloadgcc-9e3ceed8d50912e271e84389ed80aeea47184e59.zip
gcc-9e3ceed8d50912e271e84389ed80aeea47184e59.tar.gz
gcc-9e3ceed8d50912e271e84389ed80aeea47184e59.tar.bz2
Do not rely on non-SLP analysis for SLP outer loop vectorization
We end up relying on non-SLP analysis of the inner loop LC PHI to set the vectorizationb method for SLP since vectorizable_reduction claims responsibility. The following fixes this. * tree-vect-loop.cc (vect_analyze_loop_operations): Only call vectorizable_lc_phi when not PURE_SLP. (vectorizable_reduction): Do not claim having handled the inner loop LC PHI for outer loop vectorization.
Diffstat (limited to 'gcc')
-rw-r--r--gcc/tree-vect-loop.cc6
1 files changed, 4 insertions, 2 deletions
diff --git a/gcc/tree-vect-loop.cc b/gcc/tree-vect-loop.cc
index ce674a7..0342620 100644
--- a/gcc/tree-vect-loop.cc
+++ b/gcc/tree-vect-loop.cc
@@ -2171,6 +2171,7 @@ vect_analyze_loop_operations (loop_vec_info loop_vinfo)
if ((STMT_VINFO_DEF_TYPE (stmt_info) == vect_internal_def
|| (STMT_VINFO_DEF_TYPE (stmt_info)
== vect_double_reduction_def))
+ && ! PURE_SLP_STMT (stmt_info)
&& !vectorizable_lc_phi (loop_vinfo,
stmt_info, NULL, NULL))
return opt_result::failure_at (phi, "unsupported phi\n");
@@ -7770,9 +7771,10 @@ vectorizable_reduction (loop_vec_info loop_vinfo,
{
/* For SLP we arrive here for both the inner loop LC PHI and
the outer loop PHI. The latter is what we want to analyze
- the reduction with. */
+ the reduction with. The LC PHI is handled by
+ vectorizable_lc_phi. */
gcc_assert (slp_node);
- return true;
+ return gimple_phi_num_args (as_a <gphi *> (stmt_info->stmt)) == 2;
}
use_operand_p use_p;
gimple *use_stmt;