Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 13 Aug 2015 16:37:08 -0400
From:      Davide Italiano <davide.italiano@gmail.com>
To:        Andriy Gapon <avg@freebsd.org>
Cc:        Konstantin Belousov <kostikbel@gmail.com>,  "freebsd-hackers@freebsd.org" <freebsd-hackers@freebsd.org>
Subject:   Re: allow ffs & co. a binary search
Message-ID:  <CACYV=-FU=obZpzg4T_M_3k43yi5oieiKnOrPJEdZNEuKdMRdEQ@mail.gmail.com>
In-Reply-To: <5582CCF1.8010505@FreeBSD.org>
References:  <20150607081315.7c0f09fb@B85M-HD3-0.alogt.com> <5573EA5E.40806@selasky.org> <20150607195245.62dc191f@B85M-HD3-0.alogt.com> <20150607135453.GH2499@kib.kiev.ua> <558175FA.4040106@FreeBSD.org> <20150617165331.GA2080@kib.kiev.ua> <5582CCF1.8010505@FreeBSD.org>

next in thread | previous in thread | raw e-mail | index | archive | help
On Thu, Jun 18, 2015 at 9:51 AM, Andriy Gapon <avg@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@freebsd.org mailing list
> http://lists.freebsd.org/mailman/listinfo/freebsd-hackers
> To unsubscribe, send any mail to "freebsd-hackers-unsubscribe@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)



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?CACYV=-FU=obZpzg4T_M_3k43yi5oieiKnOrPJEdZNEuKdMRdEQ>