On Thu, Jan 30, 2014 at 10:28 AM, Jakub Jelinek <ja...@redhat.com> wrote: > On Wed, Jan 29, 2014 at 04:27:48PM +0100, Richard Biener wrote: >> Actually best would be to avoid generating so many useless values >> in the first place ... still, quadraticness is a complete no-go. > > Filed as PR59992. Though, we have big issues in other parts of the compiler > too, before managing to write the PR59992 testcase that seems to be > expensive only in the remove_useless_value part, I've tried e.g. > #define A(n) if (p[n]) { extern void foo##n (int, int, double); foo##n (p[n], > 5, 8.0); } > #define B(n) A(n##0) A(n##1) A(n##2) A(n##3) A(n##4) A(n##5) A(n##6) A(n##7) > A(n##8) A(n##9) > #define C(n) B(n##0) B(n##1) B(n##2) B(n##3) B(n##4) B(n##5) B(n##6) B(n##7) > B(n##8) B(n##9) > #define D(n) C(n##0) C(n##1) C(n##2) C(n##3) C(n##4) C(n##5) C(n##6) C(n##7) > C(n##8) C(n##9) > #define E(n) D(n##0) D(n##1) D(n##2) D(n##3) D(n##4) D(n##5) D(n##6) D(n##7) > D(n##8) D(n##9) > > void > foo (int *p) > { > E(1) E(2) > } > > where there is a memory hog and compile time hog in ud_dce pass (-m32 -O2 -g).
I first hit PREs compute_avail (known). But yeah - quadraticness at -O1 or -O0 is a no-go IMHO. We should avoid it everywhere else, too, of course, but ... Seems to be the df_rd_transfer_fn can be improved from bitmap_copy (&tmp, in); EXECUTE_IF_SET_IN_BITMAP (sparse_kill, 0, regno, bi) { bitmap_clear_range (&tmp, DF_DEFS_BEGIN (regno), DF_DEFS_COUNT (regno)); } bitmap_and_compl_into (&tmp, kill); to bitmap_and_compl (&tmp, in, kill); EXECUTE_IF_SET_IN_BITMAP (sparse_kill, 0, regno, bi) { bitmap_clear_range (&tmp, DF_DEFS_BEGIN (regno), DF_DEFS_COUNT (regno)); } probably doesn't save any memory though. > Jakub