Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

split OPpair into two separate loads #4909

Merged
merged 1 commit into from
Aug 19, 2015

Conversation

WalterBright
Copy link
Member

Making it two separate operations instead of one works better with the code gen designed for register operands.

@WalterBright
Copy link
Member Author

For an idea of the effect of this, consider the program:

void foo() {
    __gshared uint[2]  a1 = [0x1001_1100, 0x0220_0012];
    uint[] a = a1;
    foreach (e; a)
        bar(e);
}
void bar(uint);

Before:

_D3foo3fooFZv:
                push    EAX
                mov     ECX,offset FLAT:_D3foo3fooFZ2a1G2k
                push    EAX
                mov     EAX,2
                push    EBX
                xor     EBX,EBX
                mov     4[ESP],EAX
                mov     8[ESP],ECX
                cmp     4[ESP],EBX
                je      L30
L1D:            mov     EDX,8[ESP]
                mov     EAX,[EBX*4][EDX]
                call    near ptr _D3foo3barFkZv
                inc     EBX
                cmp     EBX,4[ESP]
                jb      L1D
L30:            pop     EBX
                add     ESP,8
                ret

After:

_D3foo3fooFZv:
                push    EBX
                xor     EBX,EBX
L3:             mov     EAX,_D3foo3fooFZ2a1G2k[EBX*4]
                call    near ptr _D3foo3barFkZv
                inc     EBX
                cmp     EBX,2
                jb      L3
                pop     EBX
                ret

MartinNowak added a commit that referenced this pull request Aug 19, 2015
split OPpair into two separate loads
@MartinNowak MartinNowak merged commit 3cd472b into dlang:master Aug 19, 2015
@WalterBright WalterBright deleted the splitpair branch August 19, 2015 23:32
@CyberShadow
Copy link
Member

This pull request caused a ~30% increase in compilation real time for the "Vibe.d diet templates" test on http://digger.k3.1azy.net/trend/

@MartinNowak
Copy link
Member

@MartinNowak
Copy link
Member

This pull request caused a ~30% increase in compilation real time for the "Vibe.d diet templates" test on http://digger.k3.1azy.net/trend/

Have you filed that as regression? Is it resolved by now?
Github comments have the tendency to get ignored.

@CyberShadow
Copy link
Member

Have you filed that as regression?

From http://forum.dlang.org/post/55F0868F.7070108@dawg.eu I understood that filing such regressions was not a desired course of action.

@WalterBright
Copy link
Member Author

This pull request caused a ~30% increase in compilation real time for the "Vibe.d diet templates" test on http://digger.k3.1azy.net/trend/

  1. do you mean dmd time or compiled application time?
  2. the link doesn't work

@CyberShadow
Copy link
Member

do you mean dmd time or compiled application time?

DMD time.

the link doesn't work

Try another web browser, some web browsers choke on big JSON blobs with nonsensical errors for some reason.

@MartinNowak
Copy link
Member

From http://forum.dlang.org/post/55F0868F.7070108@dawg.eu I understood that filing such regressions was not a desired course of action.

Well 30% slowdown is a huge change, not just a small sideeffect.

@CyberShadow
Copy link
Member

Well 30% slowdown is a huge change, not just a small sideeffect.

An even bigger one happened here:
#4924 (comment)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants