@@ -787,7 +787,7 @@ cgraph_edge (struct cgraph_node *node, gimple call_stmt)
edge, then update all components. */
void
-cgraph_set_call_stmt (struct cgraph_edge *e, gimple new_stmt,
+cgraph_set_call_stmt (struct cgraph_edge *e, gimple_call new_stmt,
bool update_speculative)
{
tree decl;
@@ -840,7 +840,7 @@ cgraph_set_call_stmt (struct cgraph_edge *e, gimple new_stmt,
static struct cgraph_edge *
cgraph_create_edge_1 (struct cgraph_node *caller, struct cgraph_node *callee,
- gimple call_stmt, gcov_type count, int freq,
+ gimple_call call_stmt, gcov_type count, int freq,
bool indir_unknown_callee)
{
struct cgraph_edge *edge;
@@ -912,7 +912,7 @@ cgraph_create_edge_1 (struct cgraph_node *caller, struct cgraph_node *callee,
struct cgraph_edge *
cgraph_create_edge (struct cgraph_node *caller, struct cgraph_node *callee,
- gimple call_stmt, gcov_type count, int freq)
+ gimple_call call_stmt, gcov_type count, int freq)
{
struct cgraph_edge *edge = cgraph_create_edge_1 (caller, callee, call_stmt,
count, freq, false);
@@ -948,7 +948,7 @@ cgraph_allocate_init_indirect_info (void)
PARAM_INDEX. */
struct cgraph_edge *
-cgraph_create_indirect_edge (struct cgraph_node *caller, gimple call_stmt,
+cgraph_create_indirect_edge (struct cgraph_node *caller, gimple_call call_stmt,
int ecf_flags,
gcov_type count, int freq)
{
@@ -1341,7 +1341,7 @@ cgraph_redirect_edge_call_stmt_to_callee (struct cgraph_edge *e)
if (e->speculative)
{
struct cgraph_edge *e2;
- gimple new_stmt;
+ gimple_call new_stmt;
struct ipa_ref *ref;
cgraph_speculative_call_info (e, e, e2, ref);
@@ -1547,7 +1547,7 @@ cgraph_update_edges_for_call_stmt_node (struct cgraph_node *node,
if (callee->decl == new_call
|| callee->former_clone_of == new_call)
{
- cgraph_set_call_stmt (e, new_stmt);
+ cgraph_set_call_stmt (e, new_stmt->as_a_gimple_call ());
return;
}
callee = callee->clone_of;
@@ -1576,13 +1576,15 @@ cgraph_update_edges_for_call_stmt_node (struct cgraph_node *node,
if (new_call)
{
ne = cgraph_create_edge (node, cgraph_get_create_node (new_call),
- new_stmt, count, frequency);
+ new_stmt->as_a_gimple_call (), count,
+ frequency);
gcc_assert (ne->inline_failed);
}
}
/* We only updated the call stmt; update pointer in cgraph edge.. */
else if (old_stmt != new_stmt)
- cgraph_set_call_stmt (cgraph_edge (node, old_stmt), new_stmt);
+ cgraph_set_call_stmt (cgraph_edge (node, old_stmt),
+ new_stmt->as_a_gimple_call ());
}
/* Update or remove the corresponding cgraph edge if a GIMPLE_CALL
@@ -579,7 +579,7 @@ struct GTY((chain_next ("%h.next_caller"), chain_prev ("%h.prev_caller"))) cgrap
struct cgraph_edge *next_caller;
struct cgraph_edge *prev_callee;
struct cgraph_edge *next_callee;
- gimple call_stmt;
+ gimple_call call_stmt;
/* Additional information about an indirect call. Not cleared when an edge
becomes direct. */
struct cgraph_indirect_call_info *indirect_info;
@@ -764,8 +764,9 @@ void release_function_body (tree);
void cgraph_node_remove_callees (struct cgraph_node *node);
struct cgraph_edge *cgraph_create_edge (struct cgraph_node *,
struct cgraph_node *,
- gimple, gcov_type, int);
-struct cgraph_edge *cgraph_create_indirect_edge (struct cgraph_node *, gimple,
+ gimple_call, gcov_type, int);
+struct cgraph_edge *cgraph_create_indirect_edge (struct cgraph_node *,
+ gimple_call,
int, gcov_type, int);
struct cgraph_indirect_call_info *cgraph_allocate_init_indirect_info (void);
struct cgraph_node * cgraph_create_node (tree);
@@ -776,7 +777,8 @@ struct cgraph_node * cgraph_add_thunk (struct cgraph_node *, tree, tree, bool, H
HOST_WIDE_INT, tree, tree);
struct cgraph_node *cgraph_node_for_asm (tree);
struct cgraph_edge *cgraph_edge (struct cgraph_node *, gimple);
-void cgraph_set_call_stmt (struct cgraph_edge *, gimple, bool update_speculative = true);
+void cgraph_set_call_stmt (struct cgraph_edge *, gimple_call,
+ bool update_speculative = true);
void cgraph_update_edges_for_call_stmt (gimple, tree, gimple);
struct cgraph_local_info *cgraph_local_info (tree);
struct cgraph_global_info *cgraph_global_info (tree);
@@ -886,7 +888,7 @@ bool expand_thunk (struct cgraph_node *, bool);
/* In cgraphclones.c */
struct cgraph_edge * cgraph_clone_edge (struct cgraph_edge *,
- struct cgraph_node *, gimple,
+ struct cgraph_node *, gimple_call,
unsigned, gcov_type, int, bool);
struct cgraph_node * cgraph_clone_node (struct cgraph_node *, tree, gcov_type,
int, bool, vec<cgraph_edge_p>,
@@ -899,11 +901,12 @@ struct cgraph_node * cgraph_create_virtual_clone (struct cgraph_node *old_node,
const char *clone_name);
struct cgraph_node *cgraph_find_replacement_node (struct cgraph_node *);
bool cgraph_remove_node_and_inline_clones (struct cgraph_node *, struct cgraph_node *);
-void cgraph_set_call_stmt_including_clones (struct cgraph_node *, gimple, gimple,
+void cgraph_set_call_stmt_including_clones (struct cgraph_node *, gimple,
+ gimple_call,
bool update_speculative = true);
void cgraph_create_edge_including_clones (struct cgraph_node *,
struct cgraph_node *,
- gimple, gimple, gcov_type, int,
+ gimple, gimple_call, gcov_type, int,
cgraph_inline_failed_t);
void cgraph_materialize_all_clones (void);
struct cgraph_node * cgraph_copy_node_for_versioning (struct cgraph_node *,
@@ -327,19 +327,19 @@ build_cgraph_edges (void)
if (is_gimple_debug (stmt))
continue;
- if (is_gimple_call (stmt))
+ if (gimple_call call_stmt = stmt->dyn_cast_gimple_call ())
{
int freq = compute_call_stmt_bb_frequency (current_function_decl,
bb);
- decl = gimple_call_fndecl (stmt);
+ decl = gimple_call_fndecl (call_stmt);
if (decl)
cgraph_create_edge (node, cgraph_get_create_node (decl),
- stmt, bb->count, freq);
- else if (gimple_call_internal_p (stmt))
+ call_stmt, bb->count, freq);
+ else if (gimple_call_internal_p (call_stmt))
;
else
- cgraph_create_indirect_edge (node, stmt,
- gimple_call_flags (stmt),
+ cgraph_create_indirect_edge (node, call_stmt,
+ gimple_call_flags (call_stmt),
bb->count, freq);
}
ipa_record_stmt_references (node, stmt);
@@ -459,19 +459,19 @@ rebuild_cgraph_edges (void)
gimple stmt = gsi_stmt (gsi);
tree decl;
- if (is_gimple_call (stmt))
+ if (gimple_call call_stmt = stmt->dyn_cast_gimple_call ())
{
int freq = compute_call_stmt_bb_frequency (current_function_decl,
bb);
- decl = gimple_call_fndecl (stmt);
+ decl = gimple_call_fndecl (call_stmt);
if (decl)
- cgraph_create_edge (node, cgraph_get_create_node (decl), stmt,
+ cgraph_create_edge (node, cgraph_get_create_node (decl), call_stmt,
bb->count, freq);
- else if (gimple_call_internal_p (stmt))
+ else if (gimple_call_internal_p (call_stmt))
;
else
- cgraph_create_indirect_edge (node, stmt,
- gimple_call_flags (stmt),
+ cgraph_create_indirect_edge (node, call_stmt,
+ gimple_call_flags (call_stmt),
bb->count, freq);
}
ipa_record_stmt_references (node, stmt);
@@ -105,7 +105,7 @@ along with GCC; see the file COPYING3. If not see
/* Create clone of E in the node N represented by CALL_EXPR the callgraph. */
struct cgraph_edge *
cgraph_clone_edge (struct cgraph_edge *e, struct cgraph_node *n,
- gimple call_stmt, unsigned stmt_uid, gcov_type count_scale,
+ gimple_call call_stmt, unsigned stmt_uid, gcov_type count_scale,
int freq_scale, bool update_original)
{
struct cgraph_edge *new_edge;
@@ -611,7 +611,7 @@ cgraph_find_replacement_node (struct cgraph_node *node)
void
cgraph_set_call_stmt_including_clones (struct cgraph_node *orig,
- gimple old_stmt, gimple new_stmt,
+ gimple old_stmt, gimple_call new_stmt,
bool update_speculative)
{
struct cgraph_node *node;
@@ -668,7 +668,7 @@ void
cgraph_create_edge_including_clones (struct cgraph_node *orig,
struct cgraph_node *callee,
gimple old_stmt,
- gimple stmt, gcov_type count,
+ gimple_call stmt, gcov_type count,
int freq,
cgraph_inline_failed_t reason)
{
@@ -782,7 +782,7 @@ fixup_call_stmt_edges_1 (struct cgraph_node *node, gimple *stmts,
{
if (gimple_stmt_max_uid (fn) < cedge->lto_stmt_uid)
fatal_error ("Cgraph edge statement index out of range");
- cedge->call_stmt = stmts[cedge->lto_stmt_uid - 1];
+ cedge->call_stmt = stmts[cedge->lto_stmt_uid - 1]->as_a_gimple_call ();
if (!cedge->call_stmt)
fatal_error ("Cgraph edge statement index not found");
}
@@ -790,7 +790,7 @@ fixup_call_stmt_edges_1 (struct cgraph_node *node, gimple *stmts,
{
if (gimple_stmt_max_uid (fn) < cedge->lto_stmt_uid)
fatal_error ("Cgraph edge statement index out of range");
- cedge->call_stmt = stmts[cedge->lto_stmt_uid - 1];
+ cedge->call_stmt = stmts[cedge->lto_stmt_uid - 1]->as_a_gimple_call ();
if (!cedge->call_stmt)
fatal_error ("Cgraph edge statement index not found");
}
@@ -11622,7 +11622,7 @@ simd_clone_adjust (struct cgraph_node *node)
tree fn = builtin_decl_explicit (BUILT_IN_ASSUME_ALIGNED);
gimple_seq seq = NULL;
bool need_cvt = false;
- gimple call
+ gimple_call call
= gimple_build_call (fn, 2, def, size_int (alignment));
g = call;
if (!useless_type_conversion_p (TREE_TYPE (orig_arg),
@@ -4990,7 +4990,7 @@ ipa_tm_insert_irr_call (struct cgraph_node *node, struct tm_region *region,
basic_block bb)
{
gimple_stmt_iterator gsi;
- gimple g;
+ gimple_call g;
transaction_subcode_ior (region, GTMA_MAY_ENTER_IRREVOCABLE);
@@ -5017,7 +5017,8 @@ ipa_tm_insert_gettmclone_call (struct cgraph_node *node,
gimple_stmt_iterator *gsi, gimple stmt)
{
tree gettm_fn, ret, old_fn, callfn;
- gimple g, g2;
+ gimple_call g;
+ gimple_assign g2;
bool safe;
old_fn = gimple_call_fn (stmt);
@@ -437,7 +437,7 @@ gen_emutls_addr (tree decl, struct lower_emutls_data *d)
{
varpool_node *cvar;
tree cdecl;
- gimple x;
+ gimple_call x;
cvar = control_vars[index];
cdecl = cvar->decl;
@@ -1764,7 +1764,7 @@ copy_bb (copy_body_data *id, basic_block bb, int frequency_scale,
/* We're duplicating a CALL_EXPR. Find any corresponding
callgraph edges and update or duplicate them. */
- if (is_gimple_call (stmt))
+ if (gimple_call call_stmt = stmt->dyn_cast_gimple_call ())
{
struct cgraph_edge *edge;
@@ -1777,7 +1777,7 @@ copy_bb (copy_body_data *id, basic_block bb, int frequency_scale,
int edge_freq = edge->frequency;
int new_freq;
struct cgraph_edge *old_edge = edge;
- edge = cgraph_clone_edge (edge, id->dst_node, stmt,
+ edge = cgraph_clone_edge (edge, id->dst_node, call_stmt,
gimple_uid (stmt),
REG_BR_PROB_BASE, CGRAPH_FREQ_BASE,
true);
@@ -1796,7 +1796,8 @@ copy_bb (copy_body_data *id, basic_block bb, int frequency_scale,
gcc_assert (!edge->indirect_unknown_callee);
cgraph_speculative_call_info (old_edge, direct, indirect, ref);
- indirect = cgraph_clone_edge (indirect, id->dst_node, stmt,
+ indirect = cgraph_clone_edge (indirect, id->dst_node,
+ call_stmt,
gimple_uid (stmt),
REG_BR_PROB_BASE, CGRAPH_FREQ_BASE,
true);
@@ -1835,14 +1836,14 @@ copy_bb (copy_body_data *id, basic_block bb, int frequency_scale,
case CB_CGE_MOVE_CLONES:
cgraph_set_call_stmt_including_clones (id->dst_node,
- orig_stmt, stmt);
+ orig_stmt, call_stmt);
edge = cgraph_edge (id->dst_node, stmt);
break;
case CB_CGE_MOVE:
edge = cgraph_edge (id->dst_node, orig_stmt);
if (edge)
- cgraph_set_call_stmt (edge, stmt);
+ cgraph_set_call_stmt (edge, call_stmt);
break;
default:
@@ -1871,12 +1872,12 @@ copy_bb (copy_body_data *id, basic_block bb, int frequency_scale,
|| !id->dst_node->definition);
if (id->transform_call_graph_edges == CB_CGE_MOVE_CLONES)
cgraph_create_edge_including_clones
- (id->dst_node, dest, orig_stmt, stmt, bb->count,
+ (id->dst_node, dest, orig_stmt, call_stmt, bb->count,
compute_call_stmt_bb_frequency (id->dst_node->decl,
copy_basic_block),
CIF_ORIGINALLY_INDIRECT_CALL);
else
- cgraph_create_edge (id->dst_node, dest, stmt,
+ cgraph_create_edge (id->dst_node, dest, call_stmt,
bb->count,
compute_call_stmt_bb_frequency
(id->dst_node->decl,
@@ -1320,11 +1320,11 @@ check_ic_target (gimple_call call_stmt, struct cgraph_node *target)
old call
*/
-gimple
-gimple_ic (gimple icall_stmt, struct cgraph_node *direct_call,
+gimple_call
+gimple_ic (gimple_call icall_stmt, struct cgraph_node *direct_call,
int prob, gcov_type count, gcov_type all)
{
- gimple dcall_stmt;
+ gimple_call dcall_stmt;
gimple_assign load_stmt;
gimple_cond cond_stmt;
tree tmp0, tmp1, tmp;
@@ -1357,7 +1357,7 @@ gimple_ic (gimple icall_stmt, struct cgraph_node *direct_call,
gimple_set_vdef (icall_stmt, NULL_TREE);
gimple_set_vuse (icall_stmt, NULL_TREE);
update_stmt (icall_stmt);
- dcall_stmt = gimple_copy (icall_stmt);
+ dcall_stmt = gimple_copy (icall_stmt)->as_a_gimple_call ();
gimple_call_set_fndecl (dcall_stmt, direct_call->decl);
dflags = flags_from_decl_or_type (direct_call->decl);
if ((dflags & ECF_NORETURN) != 0)
@@ -88,7 +88,8 @@ void gimple_move_stmt_histograms (struct function *, gimple, gimple);
void verify_histograms (void);
void free_histograms (void);
void stringop_block_profile (gimple, unsigned int *, HOST_WIDE_INT *);
-gimple gimple_ic (gimple, struct cgraph_node *, int, gcov_type, gcov_type);
+gimple_call gimple_ic (gimple_call, struct cgraph_node *, int, gcov_type,
+ gcov_type);
/* In tree-profile.c. */