Skip to content

Commit f3a29f1

Browse files
committed
cmd/compile: preallocate storage for three Value args
benchstat master2 arg3b name old time/op new time/op delta Template 441ms ± 4% 444ms ± 6% ~ (p=0.335 n=22+25) GoTypes 1.51s ± 2% 1.51s ± 2% ~ (p=0.129 n=25+21) Compiler 5.59s ± 1% 5.56s ± 2% -0.65% (p=0.001 n=24+21) name old alloc/op new alloc/op delta Template 85.6MB ± 0% 85.3MB ± 0% -0.40% (p=0.000 n=25+24) GoTypes 307MB ± 0% 305MB ± 0% -0.38% (p=0.000 n=25+25) Compiler 1.06GB ± 0% 1.05GB ± 0% -0.43% (p=0.000 n=25+25) name old allocs/op new allocs/op delta Template 1.10M ± 0% 1.09M ± 0% -1.04% (p=0.000 n=25+25) GoTypes 3.36M ± 0% 3.32M ± 0% -1.13% (p=0.000 n=25+24) Compiler 13.0M ± 0% 12.9M ± 0% -1.12% (p=0.000 n=25+25) Change-Id: I1280b846e895c00b95bb6664958a7765bd819610 Reviewed-on: https://go-review.googlesource.com/20296 Reviewed-by: Keith Randall <[email protected]>
1 parent b201871 commit f3a29f1

File tree

3 files changed

+3
-4
lines changed

3 files changed

+3
-4
lines changed

src/cmd/compile/internal/ssa/TODO

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,6 @@ Optimizations (better compiled code)
2929

3030
Optimizations (better compiler)
3131
-------------------------------
32-
- OpStore uses 3 args. Increase the size of Value.argstorage to 3?
3332
- Handle signed division overflow and sign extension earlier
3433

3534
Regalloc

src/cmd/compile/internal/ssa/sizeof_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ func TestSizeof(t *testing.T) {
2222
_32bit uintptr // size on 32bit platforms
2323
_64bit uintptr // size on 64bit platforms
2424
}{
25-
{Value{}, 60, 104},
25+
{Value{}, 64, 112},
2626
{Block{}, 124, 232},
2727
}
2828

src/cmd/compile/internal/ssa/value.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -38,8 +38,8 @@ type Value struct {
3838
// Source line number
3939
Line int32
4040

41-
// Storage for the first two args
42-
argstorage [2]*Value
41+
// Storage for the first three args
42+
argstorage [3]*Value
4343
}
4444

4545
// Examples:

0 commit comments

Comments
 (0)