]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
middle-end: don't pass loop_vinfo to vect_set_loop_condition during prolog peeling
authorTamar Christina <tamar.christina@arm.com>
Fri, 20 Oct 2023 13:58:39 +0000 (14:58 +0100)
committerTamar Christina <tamar.christina@arm.com>
Fri, 20 Oct 2023 14:00:37 +0000 (15:00 +0100)
During the refactoring I had passed loop_vinfo on to vect_set_loop_condition
during prolog peeling.  This parameter is unused in most cases except for in
vect_set_loop_condition_partial_vectors where it's behaviour depends on whether
loop_vinfo is NULL or not.  Apparently this code expect it to be NULL and it
reads the structures from a different location.

This fixes the failing testcase which was not using the lens values determined
earlier in vectorizable_store because it was looking it up in the given
loop_vinfo instead.

gcc/ChangeLog:

PR tree-optimization/111866
* tree-vect-loop-manip.cc (vect_do_peeling): Pass null as vinfo to
vect_set_loop_condition during prolog peeling.

gcc/tree-vect-loop-manip.cc

index db1d4f867ead5c6079cda3ff0d0870234d11e39d..9c2551261e33738feac71721d4f0160033907260 100644 (file)
@@ -3235,7 +3235,7 @@ vect_do_peeling (loop_vec_info loop_vinfo, tree niters, tree nitersm1,
 
       /* Update the number of iterations for prolog loop.  */
       tree step_prolog = build_one_cst (TREE_TYPE (niters_prolog));
-      vect_set_loop_condition (prolog, prolog_e, loop_vinfo, niters_prolog,
+      vect_set_loop_condition (prolog, prolog_e, NULL, niters_prolog,
                               step_prolog, NULL_TREE, false);
 
       /* Skip the prolog loop.  */