[PATCH] D55427: [libcxx] Call __count_bool_true for bitset count

Marshall Clow via Phabricator reviews at reviews.llvm.org
Thu Dec 13 07:38:57 PST 2018

mclow.lists added a comment.

In D55427#1325285 <https://reviews.llvm.org/D55427#1325285>, @zatrazz wrote:

> This patch aims to help clang with better information so it can inline
>  __bit_reference count function usage for both std::biset. Current clang
>  inliner can not infer that the passed typed will be used only to select
>  the optimized variant, it evaluates the type argument and type check as
>  a load plus compare (although later optimization phases correctly
>  optimized this out).

I'm unclear on the magnitude of the improvement here.
Are we talking a single load + compare instruction in the call to `std::count` ?
Or something inside the loop?

[ I'm pretty sure that the patch is correct now - but I don't understand how important it is ]



More information about the libcxx-commits mailing list