Be more careful about barriers when speculating conditional stores.
* 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
This commit is contained in:
parent
4d7b2a8a3b
commit
c000cd7c93
@ -1,3 +1,11 @@
|
||||
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
|
||||
|
12
gcc/gimple.c
12
gcc/gimple.c
@ -2636,6 +2636,18 @@ nonfreeing_call_p (gimple *call)
|
||||
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
|
||||
|
@ -1507,6 +1507,7 @@ extern bool gimple_call_builtin_p (const gimple *, enum built_in_function);
|
||||
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);
|
||||
|
@ -1519,7 +1519,9 @@ nontrapping_dom_walker::before_dom_children (basic_block bb)
|
||||
{
|
||||
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))
|
||||
{
|
||||
|
Loading…
Reference in New Issue
Block a user