ipa-inline-analysis.c (find_foldable_builtin_expect): Use gimple_call_internal_p.
* ipa-inline-analysis.c (find_foldable_builtin_expect): Use gimple_call_internal_p. * ipa-split.c (find_return_bb): Likewise. (execute_split_functions): Likewise. * omp-low.c (dump_oacc_loop_part): Likewise. (oacc_loop_xform_head_tail): Likewise. * predict.c (predict_loops): Likewise. * sanopt.c (pass_sanopt::execute): Likewise. * tree-cfg.c (get_abnormal_succ_dispatcher): Likewise. * tree-parloops.c (oacc_entry_exit_ok_1): Likewise. * tree-stdarg.c (gimple_call_ifn_va_arg_p): Remove function. (expand_ifn_va_arg_1): Use gimple_call_internal_p. (expand_ifn_va_arg): Likewise. * tree-vect-loop.c (vect_determine_vectorization_factor): Likewise. (optimize_mask_stores): Likewise. * tree-vect-stmts.c (vect_simd_lane_linear): Likewise. (vect_transform_stmt): Likewise. * tree-vectorizer.c (vect_loop_vectorized_call): Likewise. * tsan.c (instrument_memory_accesses): Likewise. From-SVN: r240498
This commit is contained in:
parent
6e13996688
commit
8e4284d0b2
13 changed files with 41 additions and 61 deletions
|
@ -1,3 +1,25 @@
|
|||
2016-09-26 Marek Polacek <polacek@redhat.com>
|
||||
|
||||
* ipa-inline-analysis.c (find_foldable_builtin_expect): Use
|
||||
gimple_call_internal_p.
|
||||
* ipa-split.c (find_return_bb): Likewise.
|
||||
(execute_split_functions): Likewise.
|
||||
* omp-low.c (dump_oacc_loop_part): Likewise.
|
||||
(oacc_loop_xform_head_tail): Likewise.
|
||||
* predict.c (predict_loops): Likewise.
|
||||
* sanopt.c (pass_sanopt::execute): Likewise.
|
||||
* tree-cfg.c (get_abnormal_succ_dispatcher): Likewise.
|
||||
* tree-parloops.c (oacc_entry_exit_ok_1): Likewise.
|
||||
* tree-stdarg.c (gimple_call_ifn_va_arg_p): Remove function.
|
||||
(expand_ifn_va_arg_1): Use gimple_call_internal_p.
|
||||
(expand_ifn_va_arg): Likewise.
|
||||
* tree-vect-loop.c (vect_determine_vectorization_factor): Likewise.
|
||||
(optimize_mask_stores): Likewise.
|
||||
* tree-vect-stmts.c (vect_simd_lane_linear): Likewise.
|
||||
(vect_transform_stmt): Likewise.
|
||||
* tree-vectorizer.c (vect_loop_vectorized_call): Likewise.
|
||||
* tsan.c (instrument_memory_accesses): Likewise.
|
||||
|
||||
2016-09-26 Kyrylo Tkachov <kyrylo.tkachov@arm.com>
|
||||
Alexander Monakov <amonakov@ispras.ru>
|
||||
|
||||
|
|
|
@ -2398,9 +2398,7 @@ find_foldable_builtin_expect (basic_block bb)
|
|||
{
|
||||
gimple *stmt = gsi_stmt (bsi);
|
||||
if (gimple_call_builtin_p (stmt, BUILT_IN_EXPECT)
|
||||
|| (is_gimple_call (stmt)
|
||||
&& gimple_call_internal_p (stmt)
|
||||
&& gimple_call_internal_fn (stmt) == IFN_BUILTIN_EXPECT))
|
||||
|| gimple_call_internal_p (stmt, IFN_BUILTIN_EXPECT))
|
||||
{
|
||||
tree var = gimple_call_lhs (stmt);
|
||||
tree arg = gimple_call_arg (stmt, 0);
|
||||
|
|
|
@ -788,9 +788,7 @@ find_return_bb (void)
|
|||
/* For -fsanitize=thread, allow also TSAN_FUNC_EXIT () in the return
|
||||
bb. */
|
||||
else if ((flag_sanitize & SANITIZE_THREAD)
|
||||
&& is_gimple_call (stmt)
|
||||
&& gimple_call_internal_p (stmt)
|
||||
&& gimple_call_internal_fn (stmt) == IFN_TSAN_FUNC_EXIT)
|
||||
&& gimple_call_internal_p (stmt, IFN_TSAN_FUNC_EXIT))
|
||||
;
|
||||
else
|
||||
break;
|
||||
|
@ -1840,9 +1838,7 @@ execute_split_functions (void)
|
|||
}
|
||||
|
||||
if ((flag_sanitize & SANITIZE_THREAD)
|
||||
&& is_gimple_call (stmt)
|
||||
&& gimple_call_internal_p (stmt)
|
||||
&& gimple_call_internal_fn (stmt) == IFN_TSAN_FUNC_EXIT)
|
||||
&& gimple_call_internal_p (stmt, IFN_TSAN_FUNC_EXIT))
|
||||
{
|
||||
/* We handle TSAN_FUNC_EXIT for splitting either in the
|
||||
return_bb, or in its immediate predecessors. */
|
||||
|
|
|
@ -19047,9 +19047,7 @@ dump_oacc_loop_part (FILE *file, gcall *from, int depth,
|
|||
{
|
||||
gimple *stmt = gsi_stmt (gsi);
|
||||
|
||||
if (is_gimple_call (stmt)
|
||||
&& gimple_call_internal_p (stmt)
|
||||
&& gimple_call_internal_fn (stmt) == IFN_UNIQUE)
|
||||
if (gimple_call_internal_p (stmt, IFN_UNIQUE))
|
||||
{
|
||||
enum ifn_unique_kind k
|
||||
= ((enum ifn_unique_kind) TREE_INT_CST_LOW
|
||||
|
@ -19271,10 +19269,8 @@ oacc_loop_xform_head_tail (gcall *from, int level)
|
|||
for (gimple_stmt_iterator gsi = gsi_for_stmt (from);;)
|
||||
{
|
||||
gimple *stmt = gsi_stmt (gsi);
|
||||
|
||||
if (is_gimple_call (stmt)
|
||||
&& gimple_call_internal_p (stmt)
|
||||
&& gimple_call_internal_fn (stmt) == IFN_UNIQUE)
|
||||
|
||||
if (gimple_call_internal_p (stmt, IFN_UNIQUE))
|
||||
{
|
||||
enum ifn_unique_kind k
|
||||
= ((enum ifn_unique_kind)
|
||||
|
@ -19285,9 +19281,7 @@ oacc_loop_xform_head_tail (gcall *from, int level)
|
|||
else if (k == kind && stmt != from)
|
||||
break;
|
||||
}
|
||||
else if (is_gimple_call (stmt)
|
||||
&& gimple_call_internal_p (stmt)
|
||||
&& gimple_call_internal_fn (stmt) == IFN_GOACC_REDUCTION)
|
||||
else if (gimple_call_internal_p (stmt, IFN_GOACC_REDUCTION))
|
||||
*gimple_call_arg_ptr (stmt, 3) = replacement;
|
||||
|
||||
gsi_next (&gsi);
|
||||
|
|
|
@ -2024,9 +2024,7 @@ predict_loops (void)
|
|||
&& gimple_expr_code (call_stmt) == NOP_EXPR
|
||||
&& TREE_CODE (gimple_assign_rhs1 (call_stmt)) == SSA_NAME)
|
||||
call_stmt = SSA_NAME_DEF_STMT (gimple_assign_rhs1 (call_stmt));
|
||||
if (gimple_code (call_stmt) == GIMPLE_CALL
|
||||
&& gimple_call_internal_p (call_stmt)
|
||||
&& gimple_call_internal_fn (call_stmt) == IFN_BUILTIN_EXPECT
|
||||
if (gimple_call_internal_p (call_stmt, IFN_BUILTIN_EXPECT)
|
||||
&& TREE_CODE (gimple_call_arg (call_stmt, 2)) == INTEGER_CST
|
||||
&& tree_fits_uhwi_p (gimple_call_arg (call_stmt, 2))
|
||||
&& tree_to_uhwi (gimple_call_arg (call_stmt, 2))
|
||||
|
|
|
@ -686,8 +686,7 @@ pass_sanopt::execute (function *fun)
|
|||
for (gsi = gsi_start_bb (bb); !gsi_end_p (gsi); gsi_next (&gsi))
|
||||
{
|
||||
gimple *stmt = gsi_stmt (gsi);
|
||||
if (is_gimple_call (stmt) && gimple_call_internal_p (stmt)
|
||||
&& gimple_call_internal_fn (stmt) == IFN_ASAN_CHECK)
|
||||
if (gimple_call_internal_p (stmt, IFN_ASAN_CHECK))
|
||||
++asan_num_accesses;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -621,10 +621,7 @@ get_abnormal_succ_dispatcher (basic_block bb)
|
|||
gimple_stmt_iterator gsi
|
||||
= gsi_start_nondebug_after_labels_bb (e->dest);
|
||||
gimple *g = gsi_stmt (gsi);
|
||||
if (g
|
||||
&& is_gimple_call (g)
|
||||
&& gimple_call_internal_p (g)
|
||||
&& gimple_call_internal_fn (g) == IFN_ABNORMAL_DISPATCHER)
|
||||
if (g && gimple_call_internal_p (g, IFN_ABNORMAL_DISPATCHER))
|
||||
return e->dest;
|
||||
}
|
||||
return NULL;
|
||||
|
|
|
@ -2990,9 +2990,7 @@ oacc_entry_exit_ok_1 (bitmap in_loop_bbs, vec<basic_block> region_bbs,
|
|||
&& !gimple_vdef (stmt)
|
||||
&& !gimple_vuse (stmt))
|
||||
continue;
|
||||
else if (is_gimple_call (stmt)
|
||||
&& gimple_call_internal_p (stmt)
|
||||
&& gimple_call_internal_fn (stmt) == IFN_GOACC_DIM_POS)
|
||||
else if (gimple_call_internal_p (stmt, IFN_GOACC_DIM_POS))
|
||||
continue;
|
||||
else if (gimple_code (stmt) == GIMPLE_RETURN)
|
||||
continue;
|
||||
|
|
|
@ -991,16 +991,6 @@ finish:
|
|||
}
|
||||
}
|
||||
|
||||
/* Return true if STMT is IFN_VA_ARG. */
|
||||
|
||||
static bool
|
||||
gimple_call_ifn_va_arg_p (gimple *stmt)
|
||||
{
|
||||
return (is_gimple_call (stmt)
|
||||
&& gimple_call_internal_p (stmt)
|
||||
&& gimple_call_internal_fn (stmt) == IFN_VA_ARG);
|
||||
}
|
||||
|
||||
/* Expand IFN_VA_ARGs in FUN. */
|
||||
|
||||
static void
|
||||
|
@ -1018,7 +1008,7 @@ expand_ifn_va_arg_1 (function *fun)
|
|||
tree ap, aptype, expr, lhs, type;
|
||||
gimple_seq pre = NULL, post = NULL;
|
||||
|
||||
if (!gimple_call_ifn_va_arg_p (stmt))
|
||||
if (!gimple_call_internal_p (stmt, IFN_VA_ARG))
|
||||
continue;
|
||||
|
||||
modified = true;
|
||||
|
@ -1116,7 +1106,7 @@ expand_ifn_va_arg (function *fun)
|
|||
gimple_stmt_iterator i;
|
||||
FOR_EACH_BB_FN (bb, fun)
|
||||
for (i = gsi_start_bb (bb); !gsi_end_p (i); gsi_next (&i))
|
||||
gcc_assert (!gimple_call_ifn_va_arg_p (gsi_stmt (i)));
|
||||
gcc_assert (!gimple_call_internal_p (gsi_stmt (i), IFN_VA_ARG));
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -424,9 +424,7 @@ vect_determine_vectorization_factor (loop_vec_info loop_vinfo)
|
|||
else
|
||||
{
|
||||
gcc_assert (!STMT_VINFO_DATA_REF (stmt_info));
|
||||
if (is_gimple_call (stmt)
|
||||
&& gimple_call_internal_p (stmt)
|
||||
&& gimple_call_internal_fn (stmt) == IFN_MASK_STORE)
|
||||
if (gimple_call_internal_p (stmt, IFN_MASK_STORE))
|
||||
scalar_type = TREE_TYPE (gimple_call_arg (stmt, 3));
|
||||
else
|
||||
scalar_type = TREE_TYPE (gimple_get_lhs (stmt));
|
||||
|
@ -7180,9 +7178,7 @@ optimize_mask_stores (struct loop *loop)
|
|||
gsi_next (&gsi))
|
||||
{
|
||||
stmt = gsi_stmt (gsi);
|
||||
if (is_gimple_call (stmt)
|
||||
&& gimple_call_internal_p (stmt)
|
||||
&& gimple_call_internal_fn (stmt) == IFN_MASK_STORE)
|
||||
if (gimple_call_internal_p (stmt, IFN_MASK_STORE))
|
||||
worklist.safe_push (stmt);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -3003,9 +3003,7 @@ vect_simd_lane_linear (tree op, struct loop *loop,
|
|||
default:
|
||||
return;
|
||||
}
|
||||
else if (is_gimple_call (def_stmt)
|
||||
&& gimple_call_internal_p (def_stmt)
|
||||
&& gimple_call_internal_fn (def_stmt) == IFN_GOMP_SIMD_LANE
|
||||
else if (gimple_call_internal_p (def_stmt, IFN_GOMP_SIMD_LANE)
|
||||
&& loop->simduid
|
||||
&& TREE_CODE (gimple_call_arg (def_stmt, 0)) == SSA_NAME
|
||||
&& (SSA_NAME_VAR (gimple_call_arg (def_stmt, 0))
|
||||
|
@ -8446,9 +8444,7 @@ vect_transform_stmt (gimple *stmt, gimple_stmt_iterator *gsi,
|
|||
case call_vec_info_type:
|
||||
done = vectorizable_call (stmt, gsi, &vec_stmt, slp_node);
|
||||
stmt = gsi_stmt (*gsi);
|
||||
if (is_gimple_call (stmt)
|
||||
&& gimple_call_internal_p (stmt)
|
||||
&& gimple_call_internal_fn (stmt) == IFN_MASK_STORE)
|
||||
if (gimple_call_internal_p (stmt, IFN_MASK_STORE))
|
||||
is_store = true;
|
||||
break;
|
||||
|
||||
|
|
|
@ -436,9 +436,7 @@ vect_loop_vectorized_call (struct loop *loop)
|
|||
if (!gsi_end_p (gsi))
|
||||
{
|
||||
g = gsi_stmt (gsi);
|
||||
if (is_gimple_call (g)
|
||||
&& gimple_call_internal_p (g)
|
||||
&& gimple_call_internal_fn (g) == IFN_LOOP_VECTORIZED
|
||||
if (gimple_call_internal_p (g, IFN_LOOP_VECTORIZED)
|
||||
&& (tree_to_shwi (gimple_call_arg (g, 0)) == loop->num
|
||||
|| tree_to_shwi (gimple_call_arg (g, 1)) == loop->num))
|
||||
return g;
|
||||
|
|
|
@ -779,9 +779,7 @@ instrument_memory_accesses (void)
|
|||
for (gsi = gsi_start_bb (bb); !gsi_end_p (gsi); gsi_next (&gsi))
|
||||
{
|
||||
gimple *stmt = gsi_stmt (gsi);
|
||||
if (is_gimple_call (stmt)
|
||||
&& gimple_call_internal_p (stmt)
|
||||
&& gimple_call_internal_fn (stmt) == IFN_TSAN_FUNC_EXIT)
|
||||
if (gimple_call_internal_p (stmt, IFN_TSAN_FUNC_EXIT))
|
||||
{
|
||||
if (fentry_exit_instrument)
|
||||
replace_func_exit (stmt);
|
||||
|
|
Loading…
Add table
Reference in a new issue