* gimple.h (nonbarrier_call_p): Declare.
* gimple.c (nonbarrier_call_p): New function.
* tree-ssa-phiopt.c (nontrapping_dom_walker::before_dom_children):
Also increment call phase for ASMs with vdef and potential barrier
calls.
From-SVN: r231005
+2015-11-27 Bernd Schmidt <bschmidt@redhat.com>
+
+ * gimple.h (nonbarrier_call_p): Declare.
+ * gimple.c (nonbarrier_call_p): New function.
+ * tree-ssa-phiopt.c (nontrapping_dom_walker::before_dom_children):
+ Also increment call phase for ASMs with vdef and potential barrier
+ calls.
+
2015-11-27 Kyrylo Tkachov <kyrylo.tkachov@arm.com>
* ifcvt.c (insn_valid_noce_process_p): Reject insn if it satisfies
return n->nonfreeing_fn;
}
+/* Return true when CALL is a call stmt that definitely need not
+ be considered to be a memory barrier. */
+bool
+nonbarrier_call_p (gimple *call)
+{
+ if (gimple_call_flags (call) & (ECF_PURE | ECF_CONST))
+ return true;
+ /* Should extend this to have a nonbarrier_fn flag, just as above in
+ the nonfreeing case. */
+ return false;
+}
+
/* Callback for walk_stmt_load_store_ops.
Return TRUE if OP will dereference the tree stored in DATA, FALSE
extern bool gimple_asm_clobbers_memory_p (const gasm *);
extern void dump_decl_set (FILE *, bitmap);
extern bool nonfreeing_call_p (gimple *);
+extern bool nonbarrier_call_p (gimple *);
extern bool infer_nonnull_range (gimple *, tree);
extern bool infer_nonnull_range_by_dereference (gimple *, tree);
extern bool infer_nonnull_range_by_attribute (gimple *, tree);
{
gimple *stmt = gsi_stmt (gsi);
- if (is_gimple_call (stmt) && !nonfreeing_call_p (stmt))
+ if ((gimple_code (stmt) == GIMPLE_ASM && gimple_vdef (stmt))
+ || (is_gimple_call (stmt)
+ && (!nonfreeing_call_p (stmt) || !nonbarrier_call_p (stmt))))
nt_call_phase++;
else if (gimple_assign_single_p (stmt) && !gimple_has_volatile_ops (stmt))
{