From 2866f21d191bb00c08f3a3c3a13af8b8f1a69ba4 Mon Sep 17 00:00:00 2001 From: Richard Biener Date: Fri, 9 Jun 2017 13:31:27 +0000 Subject: [PATCH] tree-ssa-loop-im.c (execute_sm): Do not force multi-threaded model if the ref is always written to. 2017-06-09 Richard Biener * 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 | 8 +++++++- gcc/tree-ssa-loop-im.c | 4 +++- 2 files changed, 10 insertions(+), 2 deletions(-) diff --git a/gcc/ChangeLog b/gcc/ChangeLog index d4d2c11617c..9706455f5a2 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,6 +1,12 @@ +2017-06-09 Richard Biener + + * 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 - * 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 diff --git a/gcc/tree-ssa-loop-im.c b/gcc/tree-ssa-loop-im.c index 2dcb85d5fad..e92eaa6e2d7 100644 --- a/gcc/tree-ssa-loop-im.c +++ b/gcc/tree-ssa-loop-im.c @@ -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 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) -- 2.30.2