Re: [PATCH] ilog2: Improve ilog2 for constant arguments

2020-11-21 Thread Luc Van Oostenryck
On Sat, Nov 21, 2020 at 09:29:54PM +0100, Jakub Jelinek wrote: > On Sat, Nov 21, 2020 at 09:23:10PM +0100, Luc Van Oostenryck wrote: > > On Fri, Nov 20, 2020 at 01:51:54PM +0100, Peter Zijlstra wrote: > > > > > > Other option would be to change the const_ilog2 macro, though as the > > > descriptio

Re: [PATCH] ilog2: Improve ilog2 for constant arguments

2020-11-21 Thread Jakub Jelinek
On Sat, Nov 21, 2020 at 09:23:10PM +0100, Luc Van Oostenryck wrote: > On Fri, Nov 20, 2020 at 01:51:54PM +0100, Peter Zijlstra wrote: > > > > Other option would be to change the const_ilog2 macro, though as the > > description says it is meant to be used also in C constant expressions, > > and whi

Re: [PATCH] ilog2: Improve ilog2 for constant arguments

2020-11-21 Thread Luc Van Oostenryck
On Fri, Nov 20, 2020 at 01:51:54PM +0100, Peter Zijlstra wrote: > > Other option would be to change the const_ilog2 macro, though as the > description says it is meant to be used also in C constant expressions, > and while GCC will fold it to constant with constant argument even in > those, perhap

[PATCH] ilog2: Improve ilog2 for constant arguments

2020-11-20 Thread Peter Zijlstra
From: Jakub Jelinek As discussed in https://gcc.gnu.org/bugzilla/show_bug.cgi?id=97445 the const_ilog2 macro generates a lot of code which interferes badly with GCC inlining heuristics, until it can be proven that the ilog2 argument can or can't be simplified into a constant. It can be expre