https://gcc.gnu.org/g:2e6d9e9f4a0db49376b1435bb6b9c5ac1badf13d
commit r15-4882-g2e6d9e9f4a0db49376b1435bb6b9c5ac1badf13d Author: Richard Biener <rguent...@suse.de> Date: Thu Oct 31 12:58:02 2024 +0100 Move vect_update_inits_of_drs Move vect_update_inits_of_drs to after setting up the epilog metadata. * tree-vect-loop.cc (update_epilogue_loop_vinfo): Update DR inits after adjusting the epilog metadata. Diff: --- gcc/tree-vect-loop.cc | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/gcc/tree-vect-loop.cc b/gcc/tree-vect-loop.cc index dd18ec9ff175..e6d241482ce3 100644 --- a/gcc/tree-vect-loop.cc +++ b/gcc/tree-vect-loop.cc @@ -12166,11 +12166,6 @@ update_epilogue_loop_vinfo (class loop *epilogue, tree advance) LOOP_VINFO_BBS (epilogue_vinfo) = epilogue_bbs; LOOP_VINFO_NBBS (epilogue_vinfo) = epilogue->num_nodes; - /* Advance data_reference's with the number of iterations of the previous - loop and its prologue. */ - vect_update_inits_of_drs (epilogue_vinfo, advance, PLUS_EXPR); - - /* The EPILOGUE loop is a copy of the original loop so they share the same gimple UIDs. In this loop we update the loop_vec_info of the EPILOGUE to point to the copied statements. We also create a mapping of all LHS' in @@ -12293,6 +12288,10 @@ update_epilogue_loop_vinfo (class loop *epilogue, tree advance) DR_STMT (dr) = STMT_VINFO_STMT (stmt_vinfo); } + /* Advance data_reference's with the number of iterations of the previous + loop and its prologue. */ + vect_update_inits_of_drs (epilogue_vinfo, advance, PLUS_EXPR); + epilogue_vinfo->shared->datarefs_copy.release (); epilogue_vinfo->shared->save_datarefs (); }