You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Im using flags:
ldmd2 -release -inline -O -noboundscheck -L-no_pie
I'm not sure why ldc gives such different results in this benchmark:
writeln(b.point); // prints 1.91474
meaning that 'x+=x.to!double_((1.2).to!int);' is 2X slower than 'x+=x.to!double_(cast(int)1);'
Basically, the compiler should recognize that ((1.2).to!int) is constant and equal to cast(int)1, so there should be no difference.
The problem seems to be that due to the amount of overflow checking in toImpl!(int, double) (including allocating the exceptions, …) LLVM doesn't inline the function into main, and thus can't optimize away the bounds checks.
Should I report such optimization issues ?
Im using flags:
ldmd2 -release -inline -O -noboundscheck -L-no_pie
I'm not sure why ldc gives such different results in this benchmark:
writeln(b.point); // prints 1.91474
meaning that 'x+=x.to!double_((1.2).to!int);' is 2X slower than 'x+=x.to!double_(cast(int)1);'
Basically, the compiler should recognize that ((1.2).to!int) is constant and equal to cast(int)1, so there should be no difference.
This is repeatable.
The text was updated successfully, but these errors were encountered: