]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
tree-optimization/106228 - fixup last change
authorRichard Biener <rguenther@suse.de>
Mon, 11 Jul 2022 10:07:05 +0000 (12:07 +0200)
committerRichard Biener <rguenther@suse.de>
Mon, 11 Jul 2022 10:09:21 +0000 (12:09 +0200)
The following fixes the last commit to honor the case we are not
vectorizing a loop.

PR tree-optimization/106228
* tree-vect-data-refs.cc (vect_setup_realignment): Adjust
VUSE compute for the non-loop case.

gcc/tree-vect-data-refs.cc

index 53e52cb58cbcceaa93e6dd71dfc54159db6e0510..609cacc4971be528e5b79969c6bfe22a99599d94 100644 (file)
@@ -5777,14 +5777,14 @@ vect_setup_realignment (vec_info *vinfo, stmt_vec_info stmt_info,
   if (at_loop)
     *at_loop = loop_for_initial_load;
 
+  tree vuse = NULL_TREE;
   if (loop_for_initial_load)
-    pe = loop_preheader_edge (loop_for_initial_load);
-
-  tree vuse;
-  gphi *vphi = get_virtual_phi (loop_for_initial_load->header);
-  if (vphi)
-    vuse = PHI_ARG_DEF_FROM_EDGE (vphi, pe);
-  else
+    {
+      pe = loop_preheader_edge (loop_for_initial_load);
+      if (gphi *vphi = get_virtual_phi (loop_for_initial_load->header))
+       vuse = PHI_ARG_DEF_FROM_EDGE (vphi, pe);
+    }
+  if (!vuse)
     vuse = gimple_vuse (gsi_stmt (*gsi));
 
   /* 3. For the case of the optimized realignment, create the first vector