<div dir="ltr">Hi Duncan,<div><br></div><div>It's possibly expected. It depends on what operation it's performing. I expected a bit of a performance drop in some cases but I have a plan to fix those.</div><div>Do you have a link to LNT?</div></div><div class="gmail_extra"><br><div class="gmail_quote">On Wed, Jul 13, 2016 at 6:41 PM, Duncan P. N. Exon Smith <span dir="ltr"><<a href="mailto:dexonsmith@apple.com" target="_blank">dexonsmith@apple.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Hmm.  I implied there were other regressions, but I just finished scanning them.  Shootout-C++/hash2 is the only major one.  The others were small, and only at -O0.<br>
<span class=""><br>
> On 2016-Jul-13, at 17:38, Duncan P. N. Exon Smith via cfe-commits <<a href="mailto:cfe-commits@lists.llvm.org">cfe-commits@lists.llvm.org</a>> wrote:<br>
><br>
> We saw mixed results from this on LNT, including some major regressions.  For example, on x86_64, SingleSource/Benchmarks/Shootout-C++/hash2 regressed 18.5% at -O3 and over 20% at -Os.<br>
><br>
> Is this expected?<br>
<br>
</span>^ Still interested in an answer, though ;).<br>
<div class="HOEnZb"><div class="h5"><br>
><br>
>> On 2016-Jul-11, at 15:02, Eric Fiselier via cfe-commits <<a href="mailto:cfe-commits@lists.llvm.org">cfe-commits@lists.llvm.org</a>> wrote:<br>
>><br>
>> Author: ericwf<br>
>> Date: Mon Jul 11 17:02:02 2016<br>
>> New Revision: 275114<br>
>><br>
>> URL: <a href="http://llvm.org/viewvc/llvm-project?rev=275114&view=rev" rel="noreferrer" target="_blank">http://llvm.org/viewvc/llvm-project?rev=275114&view=rev</a><br>
>> Log:<br>
>> Don't compute modulus of hash if it is smaller than the bucket count.<br>
>><br>
>> This cleans up a previous optimization attempt in hash, and results in<br>
>> additional performance improvements over that previous attempt. Additionally<br>
>> this new optimization does not hinder the power of 2 bucket count optimization.<br>
>><br>
>> Modified:<br>
>>   libcxx/trunk/include/__hash_table<br>
>><br>
>> Modified: libcxx/trunk/include/__hash_table<br>
>> URL: <a href="http://llvm.org/viewvc/llvm-project/libcxx/trunk/include/__hash_table?rev=275114&r1=275113&r2=275114&view=diff" rel="noreferrer" target="_blank">http://llvm.org/viewvc/llvm-project/libcxx/trunk/include/__hash_table?rev=275114&r1=275113&r2=275114&view=diff</a><br>
>> ==============================================================================<br>
>> --- libcxx/trunk/include/__hash_table (original)<br>
>> +++ libcxx/trunk/include/__hash_table Mon Jul 11 17:02:02 2016<br>
>> @@ -90,7 +90,8 @@ inline _LIBCPP_INLINE_VISIBILITY<br>
>> size_t<br>
>> __constrain_hash(size_t __h, size_t __bc)<br>
>> {<br>
>> -    return !(__bc & (__bc - 1)) ? __h & (__bc - 1) : __h % __bc;<br>
>> +    return !(__bc & (__bc - 1)) ? __h & (__bc - 1) :<br>
>> +        (__h < __bc ? __h : __h % __bc);<br>
>> }<br>
>><br>
>> inline _LIBCPP_INLINE_VISIBILITY<br>
>> @@ -2201,8 +2202,7 @@ __hash_table<_Tp, _Hash, _Equal, _Alloc><br>
>>        if (__nd != nullptr)<br>
>>        {<br>
>>            for (__nd = __nd->__next_; __nd != nullptr &&<br>
>> -                (__hash == __nd->__hash_<br>
>> -                    || __constrain_hash(__nd->__hash_, __bc) == __chash);<br>
>> +                __constrain_hash(__nd->__hash_, __bc) == __chash;<br>
>>                                                           __nd = __nd->__next_)<br>
>>            {<br>
>>                if ((__nd->__hash_ == __hash) && key_eq()(__nd->__value_, __k))<br>
>> @@ -2231,8 +2231,7 @@ __hash_table<_Tp, _Hash, _Equal, _Alloc><br>
>>        if (__nd != nullptr)<br>
>>        {<br>
>>            for (__nd = __nd->__next_; __nd != nullptr &&<br>
>> -                (__hash == __nd->__hash_<br>
>> -                    || __constrain_hash(__nd->__hash_, __bc) == __chash);<br>
>> +                  __constrain_hash(__nd->__hash_, __bc) == __chash;<br>
>>                                                           __nd = __nd->__next_)<br>
>>            {<br>
>>                if ((__nd->__hash_ == __hash) && key_eq()(__nd->__value_, __k))<br>
>><br>
>><br>
>> _______________________________________________<br>
>> cfe-commits mailing list<br>
>> <a href="mailto:cfe-commits@lists.llvm.org">cfe-commits@lists.llvm.org</a><br>
>> <a href="http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits" rel="noreferrer" target="_blank">http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits</a><br>
><br>
> _______________________________________________<br>
> cfe-commits mailing list<br>
> <a href="mailto:cfe-commits@lists.llvm.org">cfe-commits@lists.llvm.org</a><br>
> <a href="http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits" rel="noreferrer" target="_blank">http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits</a><br>
<br>
</div></div></blockquote></div><br></div>