From: Richard Biener Date: Mon, 14 Sep 2020 09:25:04 +0000 (+0200) Subject: tree-optimization/97043 - fix latent wrong-code with SLP vectorization X-Git-Tag: releases/gcc-10.3.0~905 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=e93428a8b056aed83a7678d4dc8272131ab671ba;p=thirdparty%2Fgcc.git tree-optimization/97043 - fix latent wrong-code with SLP vectorization When the unrolling decision comes late and would have prevented eliding a SLP load permutation we can end up generating aligned loads when the load is in fact unaligned. Most of the time alignment analysis figures out the load is in fact unaligned but that cannot be relied upon. The following removes the SLP load permutation eliding based on the still premature vectorization factor. 2020-09-14 Richard Biener PR tree-optimization/97043 * tree-vect-slp.c (vect_analyze_slp_instance): Do not elide a load permutation if the current vectorization factor is one. --- diff --git a/gcc/tree-vect-slp.c b/gcc/tree-vect-slp.c index f6331eeea86e..3fdf56f9335f 100644 --- a/gcc/tree-vect-slp.c +++ b/gcc/tree-vect-slp.c @@ -2309,9 +2309,8 @@ vect_analyze_slp_instance (vec_info *vinfo, /* The load requires permutation when unrolling exposes a gap either because the group is larger than the SLP group-size or because there is a gap between the groups. */ - && (known_eq (unrolling_factor, 1U) - || (group_size == DR_GROUP_SIZE (first_stmt_info) - && DR_GROUP_GAP (first_stmt_info) == 0))) + && group_size == DR_GROUP_SIZE (first_stmt_info) + && DR_GROUP_GAP (first_stmt_info) == 0) { SLP_TREE_LOAD_PERMUTATION (load_node).release (); continue;