tree-optimization/113576 - non-empty latch and may_be_zero vectorization
commit578c7b91f418ebbef1bf169117815409e06f5197
authorRichard Biener <rguenther@suse.de>
Wed, 24 Jan 2024 13:55:49 +0000 (24 14:55 +0100)
committerRichard Biener <rguenther@suse.de>
Thu, 25 Jan 2024 07:37:37 +0000 (25 08:37 +0100)
tree384a8c30ec3dafd6d8e2d05f46dbb99384f67196
parent0801a88af40e4bb41c240788a2365ca1e30e281a
tree-optimization/113576 - non-empty latch and may_be_zero vectorization

We can't support niters with may_be_zero when we end up with a
non-empty latch due to early exit peeling.  At least not in
the simplistic way the vectorizer handles this now.  Disallow
it again for exits that are not the last one.

PR tree-optimization/113576
* tree-vect-loop.cc (vec_init_loop_exit_info): Only allow
exits with may_be_zero niters when its the last one.

* gcc.dg/vect/pr113576.c: New testcase.
gcc/testsuite/gcc.dg/vect/pr113576.c [new file with mode: 0644]
gcc/tree-vect-loop.cc