Made some changes. Feng ________________________________________ From: Feng Xue OS Sent: Saturday, January 25, 2020 5:54 PM To: mjambor@suse.cz; Jan Hubicka; gcc-patches@gcc.gnu.org Subject: [PATCH] Generalized value pass-through for self-recursive function (ipa/pr93203) Besides simple pass-through (aggregate) jump function, arithmetic (aggregate) jump function could also bring same (aggregate) value as parameter passed-in for self-feeding recursive call. For example, f1 (int i) /* normal jump function */ { f1 (i & 1); } Suppose i is 0, recursive propagation via (i & 1) also gets 0, which can be seen as a simple pass-through of i. f2 (int *p) /* aggregate jump function */ { int t = *p & 1; f2 (&t); } Likewise, if *p is 0, (*p & 1) is also 0, and &t is an aggregate simple pass-through of p. This patch is to support these two kinds of value pass-through. Bootstrapped/regtested on x86_64-linux and aarch64-linux. Feng --- 2020-01-25 Feng Xue PR ipa/93203 * ipa-cp.c (ipcp_lattice::add_value): Add source with same call edge but different source value. (adjust_callers_for_value_intersection): New function. (gather_edges_for_value): Adjust order of callers to let a non-self-recursive caller be the first element. (self_recursive_pass_through_p): Add a new parameter simple, and check generalized self-recursive pass-through jump function. (self_recursive_agg_pass_through_p): Likewise. (find_more_scalar_values_for_callers_subset): Compute value from pass-through jump function for self-recursive. (intersect_with_plats): Remove code of itersection with unknown place holder value. (intersect_with_agg_replacements): Likewise. (intersect_aggregates_with_edge): Deduce with from pass-through jump function for self-recursive. (decide_whether_version_node): Remove dead callers and adjust order to let a non-self-recursive caller be the first element.