Commit 2b89b748 by Jan Hubicka Committed by Jan Hubicka

ipa-cp.c (propagate_vr_across_jump_function): Propagate also across binary operations.

	* ipa-cp.c (propagate_vr_across_jump_function): Propagate also across
	binary operations.

From-SVN: r278185
parent d772e360
2019-11-13 Jan Hubicka <hubicka@ucw.cz> 2019-11-13 Jan Hubicka <hubicka@ucw.cz>
* ipa-cp.c (propagate_vr_across_jump_function): Propagate also across
binary operations.
2019-11-13 Jan Hubicka <hubicka@ucw.cz>
* ipa-profile.c (check_argument_count): Check properly that e_info * ipa-profile.c (check_argument_count): Check properly that e_info
is non-NULL; do not check descriptors. is non-NULL; do not check descriptors.
...@@ -1975,23 +1975,51 @@ propagate_vr_across_jump_function (cgraph_edge *cs, ipa_jump_func *jfunc, ...@@ -1975,23 +1975,51 @@ propagate_vr_across_jump_function (cgraph_edge *cs, ipa_jump_func *jfunc,
if (jfunc->type == IPA_JF_PASS_THROUGH) if (jfunc->type == IPA_JF_PASS_THROUGH)
{ {
enum tree_code operation = ipa_get_jf_pass_through_operation (jfunc); enum tree_code operation = ipa_get_jf_pass_through_operation (jfunc);
class ipa_node_params *caller_info = IPA_NODE_REF (cs->caller);
int src_idx = ipa_get_jf_pass_through_formal_id (jfunc);
class ipcp_param_lattices *src_lats
= ipa_get_parm_lattices (caller_info, src_idx);
tree operand_type = ipa_get_type (caller_info, src_idx);
if (src_lats->m_value_range.bottom_p ())
return dest_lat->set_to_bottom ();
value_range vr;
if (TREE_CODE_CLASS (operation) == tcc_unary) if (TREE_CODE_CLASS (operation) == tcc_unary)
{ {
class ipa_node_params *caller_info = IPA_NODE_REF (cs->caller); ipa_vr_operation_and_type_effects (&vr,
int src_idx = ipa_get_jf_pass_through_formal_id (jfunc); &src_lats->m_value_range.m_vr,
tree operand_type = ipa_get_type (caller_info, src_idx); operation, param_type,
class ipcp_param_lattices *src_lats operand_type);
= ipa_get_parm_lattices (caller_info, src_idx); }
/* A crude way to prevent unbounded number of value range updates
if (src_lats->m_value_range.bottom_p ()) in SCC components. We should allow limited number of updates within
return dest_lat->set_to_bottom (); SCC, too. */
value_range vr; else if (!ipa_edge_within_scc (cs))
if (ipa_vr_operation_and_type_effects (&vr, {
&src_lats->m_value_range.m_vr, tree op = ipa_get_jf_pass_through_operand (jfunc);
operation, param_type, value_range op_vr (op, op);
operand_type)) value_range op_res,res;
return dest_lat->meet_with (&vr);
range_fold_binary_expr (&op_res, operation, operand_type,
&src_lats->m_value_range.m_vr, &op_vr);
ipa_vr_operation_and_type_effects (&vr,
&op_res,
NOP_EXPR, param_type,
operand_type);
}
if (!vr.undefined_p () && !vr.varying_p ())
{
if (jfunc->m_vr)
{
value_range jvr;
if (ipa_vr_operation_and_type_effects (&jvr, jfunc->m_vr,
NOP_EXPR,
param_type,
jfunc->m_vr->type ()))
vr.intersect (*jfunc->m_vr);
}
return dest_lat->meet_with (&vr);
} }
} }
else if (jfunc->type == IPA_JF_CONST) else if (jfunc->type == IPA_JF_CONST)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment