allow ffs & co. a binary search

Davide Italiano davide.italiano at gmail.com
Thu Aug 13 20:37:11 UTC 2015


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.


-- 
Davide

"A mathematical theory is not to be considered complete until you have
made it so clear that you can explain it to the first man whom you
meet on the street." (D. Hilbert)


More information about the freebsd-hackers mailing list