Remove STMT_VINFO_SAME_ALIGN_REFS
authorRichard Biener <rguenther@suse.de>
Tue, 13 Oct 2020 09:42:27 +0000 (11:42 +0200)
committerRichard Biener <rguenther@suse.de>
Tue, 13 Oct 2020 11:35:11 +0000 (13:35 +0200)
commita673744dee7a80e6525fb0da87d053c8ccab6275
treee7a3608db67dfd55be77428841e045d71cc940b7
parent35103c6d8e3ee24a2497888bb1f7ef37327ace2b
Remove STMT_VINFO_SAME_ALIGN_REFS

This makes the only consumer of STMT_VINFO_SAME_ALIGN_REFS, the
loop peeling for alignment code, use locally computed data and
then removes STMT_VINFO_SAME_ALIGN_REFS and its computation.

It also adjusts the auto_vec<> move CTOR/assignment so you
can write

  auto_vec<..> foo = bar.copy ();

and have foo own the generated copy.

2020-10-13  Richard Biener  <rguenther@suse.de>

PR tree-optimization/97382
* tree-vectorizer.h (_stmt_vec_info::same_align_refs): Remove.
(STMT_VINFO_SAME_ALIGN_REFS): Likewise.
* tree-vectorizer.c (vec_info::new_stmt_vec_info): Do not
allocate STMT_VINFO_SAME_ALIGN_REFS.
(vec_info::free_stmt_vec_info): Do not release
STMT_VINFO_SAME_ALIGN_REFS.
* tree-vect-data-refs.c (vect_analyze_data_ref_dependences):
Do not compute self and read-read dependences.
(vect_dr_aligned_if_related_peeled_dr_is): New helper.
(vect_dr_aligned_if_peeled_dr_is): Likewise.
(vect_update_misalignment_for_peel): Use it instead of
iterating over STMT_VINFO_SAME_ALIGN_REFS.
(dr_align_group_sort_cmp): New function.
(vect_enhance_data_refs_alignment): Count the number of
same aligned refs here and elide uses of STMT_VINFO_SAME_ALIGN_REFS.
(vect_find_same_alignment_drs): Remove.
(vect_analyze_data_refs_alignment): Do not call it.
* vec.h (auto_vec<T, 0>::auto_vec): Adjust CTOR to take
a vec<>&&, assert it isn't using auto storage.
(auto_vec& operator=): Apply a similar change.

* gcc.dg/vect/no-vfa-vect-dv-2.c: Remove same align dump
scanning.
* gcc.dg/vect/vect-103.c: Likewise.
* gcc.dg/vect/vect-91.c: Likewise.
* gfortran.dg/vect/vect-4.f90: Likewise.
gcc/testsuite/gcc.dg/vect/no-vfa-vect-dv-2.c
gcc/testsuite/gcc.dg/vect/vect-103.c
gcc/testsuite/gcc.dg/vect/vect-91.c
gcc/testsuite/gfortran.dg/vect/vect-4.f90
gcc/tree-vect-data-refs.c
gcc/tree-vectorizer.c
gcc/tree-vectorizer.h
gcc/vec.h