allow ffs & co. a binary search

Erich Dollansky erichsfreebsdlist at alogt.com
Fri Aug 14 01:37:56 UTC 2015


Hi,

On Thu, 13 Aug 2015 16:37:08 -0400
Davide Italiano <davide.italiano at gmail.com> wrote:

> On Thu, Jun 18, 2015 at 9:51 AM, Andriy Gapon <avg at freebsd.org> wrote:
> > On 17/06/2015 19:53, Konstantin Belousov wrote:
> >> AFAIR it was about 'sufficiently smart compiler' and the fact that
> >> the functions are not on the hottest paths.
> >
> > It seems that sufficiently smart compilers still do not exist :-)
> > At least as far as compilers that are used for compiling FreeBSD
> > are considered.
> >
> > [Offtopic] my impression is that lately smartness of compilers is
> > mostly being improved by various tricks and shortcuts (undefined
> > behavior, etc), rather than by recognizing patterns in the C code
> > that could be turned into more efficient machine code.
> >
> > --
> > Andriy Gapon
> > _______________________________________________
> > freebsd-hackers at freebsd.org mailing list
> > http://lists.freebsd.org/mailman/listinfo/freebsd-hackers
> > To unsubscribe, send any mail to
> > "freebsd-hackers-unsubscribe at freebsd.org"
> 
> Sorry for resurrect an old thread.
> I fixed in LLVM upstream (I'll try to get this pulled in FreeBSD).
> http://llvm.org/viewvc/llvm-project?view=revision&revision=244947
> It seems that we can still save another instruction, but LLVM is close
> enough to gcc now in code generation for this pattern.
> 
what does this mean? Does clang now recognise loops like this or is the
built-in function now optimised?

Erich


More information about the freebsd-hackers mailing list