Re: [Bug c/97445] Some fonctions marked static inline in Linux kernel are not inlined

2020-10-20 Thread Jan Hubicka
Hi, this implements the heuristics increasing bounds for functions having __builtin_constant_p on parameters. Note that for get_order this is still not enough, since we increase the bound twice if hint applies, so it goes from 70 to 140 and not to 190 needed, however it will handle ohter similar c

Re: [Bug c/97445] Some fonctions marked static inline in Linux kernel are not inlined

2020-10-20 Thread Jan Hubicka
> > Original asm is: > > __attribute__ ((noinline)) > int fls64(__u64 x) > { > int bitpos = -1; > asm("bsrq %1,%q0" > : "+r" (bitpos) > : "rm" (x)); > return bitpos + 1; > } > > There seems to be bug in bsr{q} pattern. I can make GCC produce same > code with: > > __attribute__ ((n

Re: [Bug c/97445] Some fonctions marked static inline in Linux kernel are not inlined

2020-10-20 Thread Jan Hubicka
> https://gcc.gnu.org/bugzilla/show_bug.cgi?id=97445 > > --- Comment #33 from Jakub Jelinek --- > (In reply to Jan Hubicka from comment #32) > > get_order is a wrapper around ffs64. This can be implemented w/o asm > > statement as follows: > > int > > my_fls64 (__u64 x) > > { > > if (!x) > >

Re: [Bug c/97445] Some fonctions marked static inline in Linux kernel are not inlined

2020-10-20 Thread Jan Hubicka
> https://gcc.gnu.org/bugzilla/show_bug.cgi?id=97445 > > --- Comment #31 from Segher Boessenkool --- > (In reply to Jan Hubicka from comment #27) > > It is because --param inline-insns-single was reduced for -O2 from 200 > > to 70. GCC 10 has newly different set of parameters for -O2 and -O3 and

Re: [Bug c/97445] Some fonctions marked static inline in Linux kernel are not inlined

2020-10-19 Thread Jan Hubicka
> https://gcc.gnu.org/bugzilla/show_bug.cgi?id=97445 > > --- Comment #23 from Christophe Leroy --- > (In reply to Jan Hubicka from comment #19) > > > > It is always possible to always_inline functions that are intended to be > > always inlined. > > Honza > > Yes and I sent a patch for that to t