tree-vect-loop-manip.c (slpeel_add_loop_guard): Preserve preheaders.
authorRichard Biener <rguenther@suse.de>
Tue, 7 Mar 2017 13:39:44 +0000 (13:39 +0000)
committerRichard Biener <rguenth@gcc.gnu.org>
Tue, 7 Mar 2017 13:39:44 +0000 (13:39 +0000)
2017-03-07  Richard Biener  <rguenther@suse.de>

* tree-vect-loop-manip.c (slpeel_add_loop_guard): Preserve
preheaders.

From-SVN: r245950

gcc/ChangeLog
gcc/tree-vect-loop-manip.c

index 8298ebb8d4dd063fb6a8db2d7441b9b72585a335..c1b71bc432e9ff7393de69f5208463db53a7d29c 100644 (file)
@@ -1,3 +1,8 @@
+2017-03-07  Richard Biener  <rguenther@suse.de>
+
+       * tree-vect-loop-manip.c (slpeel_add_loop_guard): Preserve
+       preheaders.
+
 2017-03-07  Segher Boessenkool  <segher@kernel.crashing.org>
 
        * config/i386/i386.c (ix86_local_alignment): Align most aggregates
index 5ee2c38e0484406c8afacc06a2d657f0b1a46f93..2f82061afa9720831d5742c386627cfccfe06f39 100644 (file)
@@ -569,6 +569,11 @@ slpeel_add_loop_guard (basic_block guard_bb, tree cond,
   enter_e->count -= new_e->count;
   enter_e->probability = inverse_probability (probability);
   set_immediate_dominator (CDI_DOMINATORS, guard_to, dom_bb);
+
+  /* Split enter_e to preserve LOOPS_HAVE_PREHEADERS.  */
+  if (enter_e->dest->loop_father->header == enter_e->dest)
+    split_edge (enter_e);
+
   return new_e;
 }