This patch adds logic which creates an internal callback edge when it
encounters an IFN_ASSUME internal call. It acts as a trigger for most
of the patches in this series. ipa_compute_jump_functions_for_edge has
to be called separately for the new edge, as all jump functions would
have been computed at this point in the code.
PR ipa/109112
PR tree-optimization/109045
gcc/ChangeLog:
* ipa-prop.cc (ipa_analyze_call_uses): Create an internal
callback edge when dealing with a .ASSUME internal call.
Signed-off-by: Josef Melcr <[email protected]>
---
gcc/ipa-prop.cc | 13 +++++++++++++
1 file changed, 13 insertions(+)
diff --git a/gcc/ipa-prop.cc b/gcc/ipa-prop.cc
index bc31e8e3399..0f7d9fdad0e 100644
--- a/gcc/ipa-prop.cc
+++ b/gcc/ipa-prop.cc
@@ -3213,6 +3213,19 @@ ipa_analyze_call_uses (struct ipa_func_body_info *fbi,
gcall *call)
{
tree target = gimple_call_fn (call);
+ /* Internal .ASSUME call. Create a callback edge to its body, calculate its
+ jump functions and return. This is done here as the main creation route
in
+ ipa_compute_jump_functions_for_edge doesn't analyze call statements. */
+ if (callback_ifn_assume_call_p (call))
+ {
+ tree callee_decl = TREE_OPERAND (gimple_call_arg (call, 0), 0);
+ cgraph_node *target = cgraph_node::get_create (callee_decl);
+ cgraph_edge *cbei
+ = cgraph_edge::make_callback_internal (fbi->node, target, call);
+ ipa_compute_jump_functions_for_edge (fbi, cbei);
+ return;
+ }
+
if (!target
|| (TREE_CODE (target) != SSA_NAME
&& !virtual_method_call_p (target)))
--
2.55.0