diff options
author | Richard Biener <rguenther@suse.de> | 2024-01-16 13:09:27 +0100 |
---|---|---|
committer | Richard Biener <rguenther@suse.de> | 2024-01-17 09:22:32 +0100 |
commit | 3359942417b02de88ae84d50aac232ac01ff9e15 (patch) | |
tree | 8afe57e0cf97b5b9dafee62a4341779b908cdb9a /gcc/tree-vect-loop-manip.cc | |
parent | 0c42d1782e48d8ad578ace2065cce9b3615f97c0 (diff) | |
download | gcc-3359942417b02de88ae84d50aac232ac01ff9e15.zip gcc-3359942417b02de88ae84d50aac232ac01ff9e15.tar.gz gcc-3359942417b02de88ae84d50aac232ac01ff9e15.tar.bz2 |
tree-optimization/113371 - avoid prologue peeling for peeled early exits
The following avoids prologue peeling when doing early exit
vectorization with the IV exit before the early exit. That's because
we it invalidates the invariant that the effective latch of the loop
is empty causing wrong continuation to the main loop. In particular
this is prone to break virtual SSA form.
PR tree-optimization/113371
* tree-vect-data-refs.cc (vect_enhance_data_refs_alignment):
Do not peel when LOOP_VINFO_EARLY_BREAKS_VECT_PEELED.
* tree-vect-loop-manip.cc (vect_do_peeling): Assert we do
not perform prologue peeling when LOOP_VINFO_EARLY_BREAKS_VECT_PEELED.
* gcc.dg/vect/pr113371.c: New testcase.
Diffstat (limited to 'gcc/tree-vect-loop-manip.cc')
-rw-r--r-- | gcc/tree-vect-loop-manip.cc | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/gcc/tree-vect-loop-manip.cc b/gcc/tree-vect-loop-manip.cc index c7e73f6..8aa9224 100644 --- a/gcc/tree-vect-loop-manip.cc +++ b/gcc/tree-vect-loop-manip.cc @@ -3262,7 +3262,8 @@ vect_do_peeling (loop_vec_info loop_vinfo, tree niters, tree nitersm1, { e = loop_preheader_edge (loop); edge exit_e = LOOP_VINFO_IV_EXIT (loop_vinfo); - gcc_checking_assert (slpeel_can_duplicate_loop_p (loop, exit_e, e)); + gcc_checking_assert (slpeel_can_duplicate_loop_p (loop, exit_e, e) + && !LOOP_VINFO_EARLY_BREAKS_VECT_PEELED (loop_vinfo)); /* Peel prolog and put it on preheader edge of loop. */ edge scalar_e = LOOP_VINFO_SCALAR_IV_EXIT (loop_vinfo); |