June 16, 2013
I can help with building LDC on lastest ICC with auto-vectorization.
I think it'll improve the perfomance.
June 17, 2013
On 16 Jun 2013, at 9:07, Temtaime wrote:
> I can help with building LDC on lastest ICC with auto-vectorization.
> I think it'll improve the perfomance.

Did you actually try this out in practice? I wouldn't expect LDC to be the kind of code where ICC yields a noticeable speedup.

David
June 20, 2013
Yes, i maked some tests and ICC gives better perfomance without code changes in many cases.
Other problem is, if ldc doesn't compiles by ICC.
June 22, 2013
ICC - Intel C Compiler?

For AMD processors - http://developer.amd.com/tools-and-sdks/cpu-development/amd-open64-software-development-kit/

Both Linux only.

June 24, 2013
Yes.
No, ICC available on Windows/MacOS too.

Open64 seems to be out of date.
June 25, 2013
On Monday, 24 June 2013 at 20:42:26 UTC, Temtaime wrote:
> Yes.
> No, ICC available on Windows/MacOS too.
>
> Open64 seems to be out of date.

ICC available on commercial basis, not open source. It will great if packager will have licence of ICC windows version.

Anyway amd version of open64 seems to be updated and optimized to amd chips like ICC for intel chips.

June 29, 2013
On Thursday, 20 June 2013 at 19:40:41 UTC, Temtaime wrote:
> Yes, i maked some tests and ICC gives better perfomance without code changes in many cases.
> Other problem is, if ldc doesn't compiles by ICC.

Do you have some numbers? E.g. compile time for druntime is reduced by 15%.

For LDC I suspect that there is no real benefit. As far as I know ICC is really great in auto vectorization and similar stuff. LLVM and LDC do not seem to be a good target for this...

(One of the performance killer is the memory consumption...)

Kai
July 28, 2013
Maybe I have found some more problems. The program:


import core.stdc.stdio, std.math;

void test(in double nLoops) nothrow {
    double rsin = 0.0;
    double rtan = 0.0;

    double i = 0.0;
    while (i < nLoops) {
        rsin = sin(i);
        rtan = tan(i);
        i++;
    }

    printf("i: %f\n", i);
    printf("sin: %f\n", rsin);
    printf("tan: %f\n", rtan);
}

void main() {
    test(2_000_000);
}



DMD seems to print the correct values:

i: 2000000.000000
sin: -0.989602
tan: 6.880292


The program compiled with ldmd2 (on a 32 bit Windows system, with no switches) crashes when it tries to print "i". If I comment out the printf line of "i" then the program prints:

sin: -0.000000
tan: nan

Bye,
bearophile
July 28, 2013
On Sun, Jul 28, 2013 at 7:39 PM, bearophile <bearophileHUGS@lycos.com> wrote:
> Maybe I have found some more problems. The program:

Filed as: https://github.com/ldc-developers/ldc/issues/432

David
July 31, 2013
I think I have found another small bug:


int foo(in bool b) {
    if (b == true)
        return 1;
    assert(0);
}
void main() {}


If I compile it with:
ldmd2 -O -release -noboundscheck -noruntime test.d

It gives:
Error: No implicit runtime calls allowed with -noruntime option enabled

But if I compile that program with those switches, it should turn the assert(0) into a HALT instruction, that I think has nothing to do with runtime calls.

This is the asm of foo(), it contains a call to __d_assert that I think should not be present:

__D4test3fooFxbZi:
	subl	$12, %esp
	testb	$1, %al
	je	LBB0_2
	movl	$1, %eax
	addl	$12, %esp
	ret
LBB0_2:
	movl	$6, 8(%esp)
	movl	$_.str, 4(%esp)
	movl	$6, (%esp)
	calll	__d_assert


This is how dmd compiles the same function with the same compilation switches, the assert(0) has become a hlt:

_D4test3fooFxbZi:
        push    EAX
        cmp [ESP],1
        jne LE
        pop ECX
        mov EAX,1
        ret
LE:     hlt

Bye,
bearophile