+2020-05-18 Richard Biener <rguenther@suse.de>
+
+ PR tree-optimization/95172
+ * tree-ssa-loop-im.c (execute_sm): Get flag whether we
+ eventually need the conditional processing.
+ (execute_sm_exit): When processing an orderd sequence
+ avoid doing any conditional processing.
+ (hoist_memory_references): Pass down whether all edges
+ have ordered processing for a ref to execute_sm.
+
2020-05-17 Jeff Law <law@redhat.com>
* config/h8300/predicates.md (pc_or_label_operand): New predicate.
static void
execute_sm (class loop *loop, im_mem_ref *ref,
- hash_map<im_mem_ref *, sm_aux *> &aux_map)
+ hash_map<im_mem_ref *, sm_aux *> &aux_map, bool maybe_mt)
{
gassign *load;
struct fmt_data fmt_data;
for_each_index (&ref->mem.ref, force_move_till, &fmt_data);
bool always_stored = ref_always_accessed_p (loop, ref, true);
- if (bb_in_transaction (loop_preheader_edge (loop)->src)
- || (! flag_store_data_races && ! always_stored))
+ if (maybe_mt
+ && (bb_in_transaction (loop_preheader_edge (loop)->src)
+ || (! flag_store_data_races && ! always_stored)))
multi_threaded_model_p = true;
if (multi_threaded_model_p)
else
{
sm_aux *aux = *aux_map.get (ref);
- if (!aux->store_flag)
+ if (!aux->store_flag || kind == sm_ord)
{
gassign *store;
store = gimple_build_assign (unshare_expr (ref->mem.ref),
EXECUTE_IF_SET_IN_BITMAP (mem_refs, 0, i, bi)
{
ref = memory_accesses.refs_list[i];
- execute_sm (loop, ref, aux_map);
+ execute_sm (loop, ref, aux_map, bitmap_bit_p (refs_not_supported, i));
}
/* Materialize ordered store sequences on exits. */