Find matched aggregate lattice for self-recursive CP (PR ipa/93084)
2020-01-08 Feng Xue <fxue@os.amperecomputing.com> PR ipa/93084 * ipa-cp.c (self_recursively_generated_p): Find matched aggregate lattice for a value to check. (propagate_vals_across_arith_jfunc): Add an assertion to ensure finite propagation in self-recursive scc. 2020-01-08 Feng Xue <fxue@os.amperecomputing.com> PR ipa/93084 * gcc.dg/ipa/ipa-clone-3.c: New test. From-SVN: r279987
This commit is contained in:
parent
709d7838e7
commit
42d73fa9d5
@ -1,3 +1,11 @@
|
|||||||
|
2020-01-08 Feng Xue <fxue@os.amperecomputing.com>
|
||||||
|
|
||||||
|
PR ipa/93084
|
||||||
|
* ipa-cp.c (self_recursively_generated_p): Find matched aggregate
|
||||||
|
lattice for a value to check.
|
||||||
|
(propagate_vals_across_arith_jfunc): Add an assertion to ensure
|
||||||
|
finite propagation in self-recursive scc.
|
||||||
|
|
||||||
2020-01-08 Luo Xiong Hu <luoxhu@linux.ibm.com>
|
2020-01-08 Luo Xiong Hu <luoxhu@linux.ibm.com>
|
||||||
|
|
||||||
* ipa-inline.c (caller_growth_limits): Restore the AND.
|
* ipa-inline.c (caller_growth_limits): Restore the AND.
|
||||||
|
21
gcc/ipa-cp.c
21
gcc/ipa-cp.c
@ -1917,10 +1917,25 @@ self_recursively_generated_p (ipcp_value<tree> *val)
|
|||||||
|
|
||||||
class ipcp_param_lattices *plats = ipa_get_parm_lattices (info,
|
class ipcp_param_lattices *plats = ipa_get_parm_lattices (info,
|
||||||
src->index);
|
src->index);
|
||||||
ipcp_lattice<tree> *src_lat = src->offset == -1 ? &plats->itself
|
ipcp_lattice<tree> *src_lat;
|
||||||
: plats->aggs;
|
|
||||||
ipcp_value<tree> *src_val;
|
ipcp_value<tree> *src_val;
|
||||||
|
|
||||||
|
if (src->offset == -1)
|
||||||
|
src_lat = &plats->itself;
|
||||||
|
else
|
||||||
|
{
|
||||||
|
struct ipcp_agg_lattice *src_aglat;
|
||||||
|
|
||||||
|
for (src_aglat = plats->aggs; src_aglat; src_aglat = src_aglat->next)
|
||||||
|
if (src_aglat->offset == src->offset)
|
||||||
|
break;
|
||||||
|
|
||||||
|
if (!src_aglat)
|
||||||
|
return false;
|
||||||
|
|
||||||
|
src_lat = src_aglat;
|
||||||
|
}
|
||||||
|
|
||||||
for (src_val = src_lat->values; src_val; src_val = src_val->next)
|
for (src_val = src_lat->values; src_val; src_val = src_val->next)
|
||||||
if (src_val == val)
|
if (src_val == val)
|
||||||
break;
|
break;
|
||||||
@ -2017,6 +2032,8 @@ propagate_vals_across_arith_jfunc (cgraph_edge *cs,
|
|||||||
val_seeds.safe_push (src_val);
|
val_seeds.safe_push (src_val);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
gcc_assert ((int) val_seeds.length () <= param_ipa_cp_value_list_size);
|
||||||
|
|
||||||
/* Recursively generate lattice values with a limited count. */
|
/* Recursively generate lattice values with a limited count. */
|
||||||
FOR_EACH_VEC_ELT (val_seeds, i, src_val)
|
FOR_EACH_VEC_ELT (val_seeds, i, src_val)
|
||||||
{
|
{
|
||||||
|
@ -1,3 +1,8 @@
|
|||||||
|
2020-01-08 Feng Xue <fxue@os.amperecomputing.com>
|
||||||
|
|
||||||
|
PR ipa/93084
|
||||||
|
* gcc.dg/ipa/ipa-clone-3.c: New test.
|
||||||
|
|
||||||
2020-01-07 Paolo Carlini <paolo.carlini@oracle.com>
|
2020-01-07 Paolo Carlini <paolo.carlini@oracle.com>
|
||||||
|
|
||||||
* g++.old-deja/g++.bugs/900208_03.C: Check locations too.
|
* g++.old-deja/g++.bugs/900208_03.C: Check locations too.
|
||||||
|
42
gcc/testsuite/gcc.dg/ipa/ipa-clone-3.c
Normal file
42
gcc/testsuite/gcc.dg/ipa/ipa-clone-3.c
Normal file
@ -0,0 +1,42 @@
|
|||||||
|
/* { dg-do compile } */
|
||||||
|
/* { dg-options "-O3 -fdump-ipa-cp-details -fno-early-inlining --param ipa-cp-max-recursive-depth=8 --param ipa-cp-eval-threshold=1" } */
|
||||||
|
|
||||||
|
struct V {
|
||||||
|
int f0;
|
||||||
|
int f1;
|
||||||
|
};
|
||||||
|
|
||||||
|
int data[100];
|
||||||
|
|
||||||
|
int fn ();
|
||||||
|
|
||||||
|
int recur_fn (struct V * __restrict v)
|
||||||
|
{
|
||||||
|
int i = v->f0;
|
||||||
|
int j = v->f1;
|
||||||
|
struct V t;
|
||||||
|
|
||||||
|
if (j > 100)
|
||||||
|
{
|
||||||
|
fn ();
|
||||||
|
return 1;
|
||||||
|
}
|
||||||
|
|
||||||
|
data[i] = i;
|
||||||
|
|
||||||
|
t.f0 = i - 2;
|
||||||
|
t.f1 = j + 1;
|
||||||
|
|
||||||
|
recur_fn (&t);
|
||||||
|
|
||||||
|
return i * j;
|
||||||
|
}
|
||||||
|
|
||||||
|
int main ()
|
||||||
|
{
|
||||||
|
struct V v = {1, 3};
|
||||||
|
|
||||||
|
return recur_fn (&v);
|
||||||
|
}
|
||||||
|
|
||||||
|
/* { dg-final { scan-ipa-dump-times "Creating a specialized node of recur_fn/\[0-9\]*\\." 8 "cp" } } */
|
Loading…
Reference in New Issue
Block a user