Skip to content

Commit 2cadaa1

Browse files
author
Jan Hubicka
committed
Minor ipa-modref tweaks
To make dumps easier to read modref now dumps cgraph_node name rather then cfun name in function being analysed and I also fixed minor issue with ECF flags merging when updating inline summary. gcc/ChangeLog: 2021-11-26 Jan Hubicka <[email protected]> * ipa-modref.c (analyze_function): Drop parameter F and dump cgraph node name rather than cfun name. (modref_generate): Update. (modref_summaries::insert):Update. (modref_summaries_lto::insert):Update. (pass_modref::execute):Update. (ipa_merge_modref_summary_after_inlining): Improve combining of ECF_FLAGS.
1 parent 906cad8 commit 2cadaa1

File tree

1 file changed

+13
-11
lines changed

1 file changed

+13
-11
lines changed

gcc/ipa-modref.c

Lines changed: 13 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -2943,17 +2943,17 @@ analyze_parms (modref_summary *summary, modref_summary_lto *summary_lto,
29432943
}
29442944
}
29452945

2946-
/* Analyze function F. IPA indicates whether we're running in local mode
2946+
/* Analyze function. IPA indicates whether we're running in local mode
29472947
(false) or the IPA mode (true).
29482948
Return true if fixup cfg is needed after the pass. */
29492949

29502950
static bool
2951-
analyze_function (function *f, bool ipa)
2951+
analyze_function (bool ipa)
29522952
{
29532953
bool fixup_cfg = false;
29542954
if (dump_file)
2955-
fprintf (dump_file, "modref analyzing '%s' (ipa=%i)%s%s\n",
2956-
function_name (f), ipa,
2955+
fprintf (dump_file, "\n\nmodref analyzing '%s' (ipa=%i)%s%s\n",
2956+
cgraph_node::get (current_function_decl)->dump_name (), ipa,
29572957
TREE_READONLY (current_function_decl) ? " (const)" : "",
29582958
DECL_PURE_P (current_function_decl) ? " (pure)" : "");
29592959

@@ -3224,7 +3224,7 @@ modref_generate (void)
32243224
if (!f)
32253225
continue;
32263226
push_cfun (f);
3227-
analyze_function (f, true);
3227+
analyze_function (true);
32283228
pop_cfun ();
32293229
}
32303230
}
@@ -3257,7 +3257,7 @@ modref_summaries::insert (struct cgraph_node *node, modref_summary *)
32573257
return;
32583258
}
32593259
push_cfun (DECL_STRUCT_FUNCTION (node->decl));
3260-
analyze_function (DECL_STRUCT_FUNCTION (node->decl), true);
3260+
analyze_function (true);
32613261
pop_cfun ();
32623262
}
32633263

@@ -3277,7 +3277,7 @@ modref_summaries_lto::insert (struct cgraph_node *node, modref_summary_lto *)
32773277
return;
32783278
}
32793279
push_cfun (DECL_STRUCT_FUNCTION (node->decl));
3280-
analyze_function (DECL_STRUCT_FUNCTION (node->decl), true);
3280+
analyze_function (true);
32813281
pop_cfun ();
32823282
}
32833283

@@ -4032,9 +4032,9 @@ class pass_ipa_modref : public ipa_opt_pass_d
40324032

40334033
}
40344034

4035-
unsigned int pass_modref::execute (function *f)
4035+
unsigned int pass_modref::execute (function *)
40364036
{
4037-
if (analyze_function (f, false))
4037+
if (analyze_function (false))
40384038
return execute_fixup_cfg ();
40394039
return 0;
40404040
}
@@ -5106,8 +5106,10 @@ ipa_merge_modref_summary_after_inlining (cgraph_edge *edge)
51065106
= summaries_lto ? summaries_lto->get (edge->callee) : NULL;
51075107
int flags = flags_from_decl_or_type (edge->callee->decl);
51085108
/* Combine in outer flags. */
5109-
for (cgraph_node *n = edge->caller; n->inlined_to; n = n->callers->caller)
5110-
flags |= flags_from_decl_or_type (edge->callee->decl);
5109+
cgraph_node *n;
5110+
for (n = edge->caller; n->inlined_to; n = n->callers->caller)
5111+
flags |= flags_from_decl_or_type (n->decl);
5112+
flags |= flags_from_decl_or_type (n->decl);
51115113
bool ignore_stores = ignore_stores_p (edge->caller->decl, flags);
51125114

51135115
if (!callee_info && to_info)

0 commit comments

Comments
 (0)