On Sunday, 9 June 2019 at 05:24:56 UTC, Amex wrote:
Can dmd or ldc optimize the following cases:
foo(int x)
{
if (x > 10 && x < 100) bar1; else bar2;
}
...
for(int i = 23; i < 55; i++)
foo(i); // equivalent to calling bar1(i)
clearly i is within the range of the if in foo and so the
c
Can dmd or ldc optimize the following cases:
foo(int x)
{
if (x > 10 && x < 100) bar1; else bar2;
}
...
for(int i = 23; i < 55; i++)
foo(i); // equivalent to calling bar1(i)
clearly i is within the range of the if in foo and so the checks
are unnecessary.
I realize that this is gener