> On 12 Oct 2016, at 23:05, Joe Groff via swift-users
> wrote:
>
>>
>> On Oct 12, 2016, at 2:25 AM, Gerriet M. Denkmann via swift-users
>> wrote:
>>
>> uint64_t nbrBytes = 4e8;
>> uint64_t count = 0;
>> for( uint64_t byteIndex = 0; byteIndex < nbrBytes; byteIndex++ )
>> {
>> count += b
> On Oct 12, 2016, at 9:05 AM, Joe Groff via swift-users
> wrote:
>
> It looks like LLVM does not recognize the overflow traps Swift emits on
> arithmetic operations as dead code, so that prevents it from completely
> eliminating the Swift loop. That's a bug worth fixing in Swift, but unlike
> On Oct 12, 2016, at 2:25 AM, Gerriet M. Denkmann via swift-users
> wrote:
>
> uint64_t nbrBytes = 4e8;
> uint64_t count = 0;
> for( uint64_t byteIndex = 0; byteIndex < nbrBytes; byteIndex++ )
> {
> count += byteIndex;
> if ( ( byteIndex & 0x ) == 0 ) { count += 1.3; } (AA
> On Oct 12, 2016, at 2:25 AM, Gerriet M. Denkmann via swift-users
> wrote:
>
> uint64_t nbrBytes = 4e8;
> uint64_t count = 0;
> for( uint64_t byteIndex = 0; byteIndex < nbrBytes; byteIndex++ )
> {
> count += byteIndex;
> if ( ( byteIndex & 0x ) == 0 ) { count += 1.3; } (AA
uint64_t nbrBytes = 4e8;
uint64_t count = 0;
for( uint64_t byteIndex = 0; byteIndex < nbrBytes; byteIndex++ )
{
count += byteIndex;
if ( ( byteIndex & 0x ) == 0 ) { count += 1.3; } (AAA)
};
Takes 260 msec.
Btw.: Without the (AAA) line the whole loop is done in 10 μsec. A