]> Cypherpunks repositories - gostls13.git/commitdiff
cmd/5g, cmd/6g, cmd/8g: clear Addr node when registerizing
authorJosh Bleecher Snyder <josharian@gmail.com>
Mon, 25 Aug 2014 02:07:27 +0000 (19:07 -0700)
committerJosh Bleecher Snyder <josharian@gmail.com>
Mon, 25 Aug 2014 02:07:27 +0000 (19:07 -0700)
Update #8525

Some temporary variables that were fully registerized nevertheless had stack space allocated for them because the Addrs were still marked as having associated nodes.

Distribution of stack space reserved for temporary variables while running make.bash (6g):

BEFORE

40.89%  7026 allocauto: 0 to 0
 7.83%  1346 allocauto: 0 to 24
 7.22%  1241 allocauto: 0 to 8
 6.30%  1082 allocauto: 0 to 16
 4.96%   853 allocauto: 0 to 56
 4.59%   789 allocauto: 0 to 32
 2.97%   510 allocauto: 0 to 40
 2.32%   399 allocauto: 0 to 48
 2.10%   360 allocauto: 0 to 64
 1.91%   328 allocauto: 0 to 72

AFTER

48.49%  8332 allocauto: 0 to 0
 9.52%  1635 allocauto: 0 to 16
 5.28%   908 allocauto: 0 to 48
 4.80%   824 allocauto: 0 to 32
 4.73%   812 allocauto: 0 to 8
 3.38%   581 allocauto: 0 to 24
 2.35%   404 allocauto: 0 to 40
 2.32%   399 allocauto: 0 to 64
 1.65%   284 allocauto: 0 to 56
 1.34%   230 allocauto: 0 to 72

LGTM=rsc
R=rsc
CC=dave, dvyukov, golang-codereviews, minux
https://golang.org/cl/126160043

src/cmd/5g/reg.c
src/cmd/6g/reg.c
src/cmd/8g/reg.c

index d259a232e60a419e02738f39f7868668452e47ef..8e49a2d9c83b795da1b97f2cfb70032bde1f016e 100644 (file)
@@ -1315,6 +1315,7 @@ void
 addreg(Adr *a, int rn)
 {
        a->sym = nil;
+       a->node = nil;
        a->name = D_NONE;
        a->type = D_REG;
        a->reg = rn;
index 5e3a198186176052ffad2507b324f180bbf13f6c..1f757e1972057fb989ab471a720cda33cebcbac0 100644 (file)
@@ -1191,6 +1191,7 @@ void
 addreg(Adr *a, int rn)
 {
        a->sym = nil;
+       a->node = nil;
        a->offset = 0;
        a->type = rn;
 
index a69d124db80cb8b58b624c77f5bad8a0bc1343d8..302b273a1b4f5fa4c02146fc03446f41bfa7c163 100644 (file)
@@ -1168,6 +1168,7 @@ void
 addreg(Adr *a, int rn)
 {
        a->sym = nil;
+       a->node = nil;
        a->offset = 0;
        a->type = rn;