tree-ssa-loop-im.c (execute_sm): Do not force multi-threaded model if the ref is...
authorRichard Biener <rguenth@gcc.gnu.org>
Fri, 9 Jun 2017 13:31:27 +0000 (13:31 +0000)
committerRichard Biener <rguenth@gcc.gnu.org>
Fri, 9 Jun 2017 13:31:27 +0000 (13:31 +0000)
2017-06-09  Richard Biener  <rguenther@suse.de>

* tree-ssa-loop-im.c (execute_sm): Do not force multi-threaded
model if the ref is always written to.

From-SVN: r249063

gcc/ChangeLog
gcc/tree-ssa-loop-im.c

index d4d2c11..9706455 100644 (file)
@@ -1,6 +1,12 @@
+2017-06-09  Richard Biener  <rguenther@suse.de>
+
+       * tree-ssa-loop-im.c (execute_sm): Do not force multi-threaded
+       model if the ref is always written to.
+
 2017-06-09  Tamar Christina  <tamar.christina@arm.com>
 
-       * config/arm/arm.c (arm_rtx_costs_internal): Make sdiv more expensive than udiv.
+       * config/arm/arm.c (arm_rtx_costs_internal): Make sdiv more expensive
+       than udiv.
 
 2017-06-09  Tom de Vries  <tom@codesourcery.com>
 
index 2dcb85d..e92eaa6 100644 (file)
@@ -198,6 +198,7 @@ static bitmap_obstack lim_bitmap_obstack;
 static obstack mem_ref_obstack;
 
 static bool ref_indep_loop_p (struct loop *, im_mem_ref *, struct loop *);
+static bool ref_always_accessed_p (struct loop *, im_mem_ref *, bool);
 
 /* Minimum cost of an expensive expression.  */
 #define LIM_EXPENSIVE ((unsigned) PARAM_VALUE (PARAM_LIM_EXPENSIVE))
@@ -2025,7 +2026,8 @@ execute_sm (struct loop *loop, vec<edge> exits, im_mem_ref *ref)
   for_each_index (&ref->mem.ref, force_move_till, &fmt_data);
 
   if (bb_in_transaction (loop_preheader_edge (loop)->src)
-      || !PARAM_VALUE (PARAM_ALLOW_STORE_DATA_RACES))
+      || (! PARAM_VALUE (PARAM_ALLOW_STORE_DATA_RACES)
+         && ! ref_always_accessed_p (loop, ref, true)))
     multi_threaded_model_p = true;
 
   if (multi_threaded_model_p)