Re: [PATCH] find_bit: Micro-optimise find_next_*_bit

From: Rasmus Villemoes
Date: Fri Dec 23 2016 - 15:44:01 EST


On Fri, Dec 23 2016, Matthew Wilcox <mawilcox@xxxxxxxxxxxxxxxxx> wrote:

> From: Matthew Wilcox <mawilcox@xxxxxxxxxxxxx>
>
> First, the first half of the test: (!nbits || start >= nbits) is
> trivially a subset of the second half, since nbits and start are both unsigned.

Yeah, I filed that as a missed optimization bug with gcc a year ago, but
it seems that even 6.3 still does two tests - clang 3.6 is a bit
smarter. Anyway,

Acked-by: Rasmus Villemoes <linux@xxxxxxxxxxxxxxxxxx>