+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>
{
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);
/* 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;
}
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. */
{
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
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)
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);
&& 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))
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;
}
}
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;
&& !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;
}
}
-/* 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
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;
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));
}
}
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));
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);
}
}
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))
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;
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;
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);