Skip to content

Commit 2383ed1

Browse files
rguenthRichard Biener
authored andcommitted
tree-optimization/117698 - SLP vectorization and alignment
When SLP vectorizing we fail to mark the general alignment check as irrelevant when using VMAT_STRIDED_SLP (the implementation checks for itself) and when VMAT_INVARIANT the override isn't effective. This results in extra FAILs on sparc which the following fixes. PR tree-optimization/117698 * tree-vect-stmts.cc (get_group_load_store_type): Properly disregard alignment for VMAT_STRIDED_SLP and VMAT_INVARIANT. (vectorizable_load): Adjust guard for dumping whether we vectorize and unaligned access. (vectorizable_store): Likewise.
1 parent 16cf1c0 commit 2383ed1

File tree

1 file changed

+7
-4
lines changed

1 file changed

+7
-4
lines changed

gcc/tree-vect-stmts.cc

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2121,9 +2121,6 @@ get_group_load_store_type (vec_info *vinfo, stmt_vec_info stmt_info,
21212121
{
21222122
gcc_assert (vls_type == VLS_LOAD);
21232123
*memory_access_type = VMAT_INVARIANT;
2124-
/* Invariant accesses perform only component accesses, alignment
2125-
is irrelevant for them. */
2126-
*alignment_support_scheme = dr_unaligned_supported;
21272124
}
21282125
/* Try using LOAD/STORE_LANES. */
21292126
else if (slp_node->ldst_lanes
@@ -2379,7 +2376,9 @@ get_group_load_store_type (vec_info *vinfo, stmt_vec_info stmt_info,
23792376
*memory_access_type = VMAT_GATHER_SCATTER;
23802377

23812378
if (*memory_access_type == VMAT_GATHER_SCATTER
2382-
|| *memory_access_type == VMAT_ELEMENTWISE)
2379+
|| *memory_access_type == VMAT_ELEMENTWISE
2380+
|| *memory_access_type == VMAT_STRIDED_SLP
2381+
|| *memory_access_type == VMAT_INVARIANT)
23832382
{
23842383
*alignment_support_scheme = dr_unaligned_supported;
23852384
*misalignment = DR_MISALIGNMENT_UNKNOWN;
@@ -8497,6 +8496,8 @@ vectorizable_store (vec_info *vinfo,
84978496
if (dump_enabled_p ()
84988497
&& memory_access_type != VMAT_ELEMENTWISE
84998498
&& memory_access_type != VMAT_GATHER_SCATTER
8499+
&& memory_access_type != VMAT_STRIDED_SLP
8500+
&& memory_access_type != VMAT_INVARIANT
85008501
&& alignment_support_scheme != dr_aligned)
85018502
dump_printf_loc (MSG_NOTE, vect_location,
85028503
"Vectorizing an unaligned access.\n");
@@ -10410,6 +10411,8 @@ vectorizable_load (vec_info *vinfo,
1041010411
if (dump_enabled_p ()
1041110412
&& memory_access_type != VMAT_ELEMENTWISE
1041210413
&& memory_access_type != VMAT_GATHER_SCATTER
10414+
&& memory_access_type != VMAT_STRIDED_SLP
10415+
&& memory_access_type != VMAT_INVARIANT
1041310416
&& alignment_support_scheme != dr_aligned)
1041410417
dump_printf_loc (MSG_NOTE, vect_location,
1041510418
"Vectorizing an unaligned access.\n");

0 commit comments

Comments
 (0)