tree-optimization/113373 - add missing LC PHIs for live operations
commit86f3cbdaa6f60eaff1cdb4ab2f1a9bc796b67207
authorRichard Biener <rguenther@suse.de>
Fri, 19 Jan 2024 12:55:09 +0000 (19 13:55 +0100)
committerRichard Biener <rguenther@suse.de>
Mon, 22 Jan 2024 07:48:26 +0000 (22 08:48 +0100)
tree702e743b95c9c643df4c16dd2f735212b648c736
parenta618b3c65745a6992ced4df60c186241c2da6eae
tree-optimization/113373 - add missing LC PHIs for live operations

The following makes reduction epilogue code generation happy by properly
adding LC PHIs to the exit blocks for multiple exit vectorized loops.

Some refactoring might make the flow easier to follow but I've refrained
from doing that with this patch.

I've kept some fixes in reduction epilogue generation from the earlier
attempt fixing this PR.

PR tree-optimization/113373
* tree-vect-loop-manip.cc (slpeel_tree_duplicate_loop_to_edge_cfg):
Create LC PHIs in the exit blocks where necessary.
* tree-vect-loop.cc (vectorizable_live_operation): Do not try
to handle missing LC PHIs.
(find_connected_edge): Remove.
(vect_create_epilog_for_reduction): Cleanup use of auto_vec.

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