go/src/cmd/compile/internal/gc
Martin Möhrmann 8a6e51aede cmd/compile: generate makechan calls with int arguments
Where possible generate calls to runtime makechan with int arguments
during compile time instead of makechan with int64 arguments.

This eliminates converting arguments for calls to makechan with
int64 arguments for platforms where int64 values do not fit into
arguments of type int.

A similar optimization for makeslice was introduced in CL
golang.org/cl/27851.

386:
name                old time/op  new time/op  delta
MakeChan/Byte       52.4ns ± 6%  45.0ns ± 1%  -14.14%  (p=0.000 n=10+10)
MakeChan/Int        54.5ns ± 1%  49.1ns ± 1%   -9.87%  (p=0.000 n=10+10)
MakeChan/Ptr         150ns ± 1%   143ns ± 0%   -4.38%  (p=0.000 n=9+7)
MakeChan/Struct/0   49.2ns ± 2%  43.2ns ± 2%  -12.27%  (p=0.000 n=10+10)
MakeChan/Struct/32  81.7ns ± 2%  76.2ns ± 1%   -6.71%  (p=0.000 n=10+10)
MakeChan/Struct/40  88.4ns ± 2%  82.5ns ± 2%   -6.60%  (p=0.000 n=10+10)

AMD64:
name                old time/op  new time/op  delta
MakeChan/Byte       83.4ns ± 8%  80.8ns ± 3%    ~     (p=0.171 n=10+10)
MakeChan/Int         101ns ± 3%   101ns ± 2%    ~     (p=0.412 n=10+10)
MakeChan/Ptr         128ns ± 1%   128ns ± 1%    ~     (p=0.191 n=10+10)
MakeChan/Struct/0   67.6ns ± 3%  68.7ns ± 4%    ~     (p=0.224 n=10+10)
MakeChan/Struct/32   138ns ± 1%   139ns ± 1%    ~     (p=0.185 n=10+9)
MakeChan/Struct/40   154ns ± 1%   154ns ± 1%  -0.55%  (p=0.027 n=10+9)

Change-Id: Ie854cb066007232c5e9f71ea7d6fe27e81a9c050
Reviewed-on: https://go-review.googlesource.com/55140
Run-TryBot: Martin Möhrmann <moehrmann@google.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Keith Randall <khr@golang.org>
2017-08-15 05:54:24 +00:00
..
builtin cmd/compile: generate makechan calls with int arguments 2017-08-15 05:54:24 +00:00
testdata cmd/compile: make builds reproducible in presence of **byte and **int8 2017-05-09 21:15:12 +00:00
alg.go cmd/compile: remove some unused params in gc 2017-08-09 22:29:19 +00:00
align.go cmd/compile: check width of embedded interfaces in expandiface 2017-04-28 20:07:38 +00:00
asm_test.go cmd/compile: set/unset base register for better assembly print 2017-08-02 12:24:02 +00:00
bexport.go cmd/compile: fix crash in importer when running in debug mode 2017-06-15 22:27:53 +00:00
bimport.go Revert "Revert "cmd/compile: discard duplicate inline method bodies"" 2017-08-14 01:38:08 +00:00
bitset.go cmd/compile: minor cleanup 2017-04-26 18:01:14 +00:00
bootstrap.go cmd/compile: add mutex profiling support 2017-04-05 22:10:54 +00:00
builtin.go cmd/compile: generate makechan calls with int arguments 2017-08-15 05:54:24 +00:00
builtin_test.go all: use testing.GoToolPath instead of "go" 2016-08-30 22:49:11 +00:00
bv.go cmd/compile: Fatal instead of panic in large bvbulkalloc 2017-04-03 23:28:29 +00:00
class_string.go cmd/compile: make Class a Stringer 2017-04-30 16:26:09 +00:00
closure.go cmd/compile: remove some unused params in gc 2017-08-09 22:29:19 +00:00
const.go cmd/compile: don't panic in complex division 2017-05-18 16:39:05 +00:00
constFold_test.go cmd/compile: use std "DO NOT EDIT" comment for generated files 2017-03-31 18:50:40 +00:00
dcl.go runtime, cmd/compile: add intrinsic getclosureptr 2017-08-11 18:11:22 +00:00
esc.go cmd/compile: fix lexical scope of escaped variables 2017-07-10 20:09:00 +00:00
export.go Revert "cmd/compile: skip reexporting types in reexportdep" 2017-06-15 18:43:48 +00:00
fixedbugs_test.go cmd/compile: inline convT2{I,E} when result doesn't escape 2016-09-19 02:37:08 +00:00
float_test.go cmd/compile: strength-reduce floating point 2017-04-03 21:27:03 +00:00
fmt.go cmd/compile: change ssa.Type into *types.Type 2017-05-09 23:01:51 +00:00
gen.go cmd/compile: unexport gc.Sysfunc 2017-08-11 00:27:35 +00:00
global_test.go all: use testing.GoToolPath instead of "go" 2016-08-30 22:49:11 +00:00
go.go cmd/compile: remove gc.Sysfunc calls from 387 backend 2017-08-09 00:19:58 +00:00
gsubr.go cmd/compile: move nodarg to walk.go 2017-04-27 19:08:26 +00:00
iface_test.go cmd/compile: inline convT2{I,E} when result doesn't escape 2016-09-19 02:37:08 +00:00
init.go cmd/compile: remove some unused params in gc 2017-08-09 22:29:19 +00:00
inl.go cmd/compile: retain source positions of arguments to inlined calls 2017-06-02 13:41:01 +00:00
lex.go cmd/internal/objabi: extract shared functionality from obj 2017-04-19 00:00:09 +00:00
lex_test.go cmd/compile: provide line number for cgo directive error (fix a TODO) 2017-02-02 21:24:50 +00:00
logic_test.go cmd/compile: add tests for logical simplification rewrite rules 2016-05-26 22:16:52 +00:00
main.go [dev.debug] cmd/compile: better DWARF with optimizations on 2017-07-27 20:19:44 +00:00
mkbuiltin.go cmd/compile: factor out Pkg, Sym, and Type into package types 2017-04-07 03:04:00 +00:00
mpfloat.go cmd/compile: better errors for float constants with large exponents 2017-05-08 22:56:10 +00:00
mpint.go cmd/compile: use Fatalf for more internal errors 2017-03-14 17:58:38 +00:00
noder.go cmd/compile: remove some unused params in gc 2017-08-09 22:29:19 +00:00
norace.go cmd/compile: randomize compilation order when race-enabled 2017-04-27 19:27:22 +00:00
obj.go cmd/internal/obj: fix LSym.Type during compilation, not linking 2017-05-02 00:21:33 +00:00
opnames.go cmd/compile: check loop rescheduling with stack bound, not counter 2017-03-08 18:52:12 +00:00
order.go cmd/compile: move Node.Class to flags 2017-04-26 16:58:33 +00:00
pgen.go [dev.debug] cmd/compile: better DWARF with optimizations on 2017-07-27 20:19:44 +00:00
pgen_test.go cmd/compile: move Used from gc.Node to gc.Name 2017-04-27 22:58:13 +00:00
phi.go cmd/compile: change ssa.Type into *types.Type 2017-05-09 23:01:51 +00:00
plive.go cmd/compile: change ssa.Type into *types.Type 2017-05-09 23:01:51 +00:00
pprof.go cmd/compile: add mutex profiling support 2017-04-05 22:10:54 +00:00
race.go cmd/compile: randomize compilation order when race-enabled 2017-04-27 19:27:22 +00:00
racewalk.go cmd/compile: move Node.Class to flags 2017-04-26 16:58:33 +00:00
range.go cmd/compile: make loop guard+rotate conditional on GOEXPERIMENT 2017-06-21 22:07:33 +00:00
reflect.go runtime: remove link field from itab 2017-08-15 01:52:35 +00:00
reflect_test.go cmd/internal/obj: add SortSlice 2017-04-11 20:29:04 +00:00
reproduciblebuilds_test.go cmd/compile: make builds reproducible in presence of **byte and **int8 2017-05-09 21:15:12 +00:00
scope.go [dev.debug] cmd/compile: rename dwarf.Var.Offset to StackOffset 2017-07-25 19:33:14 +00:00
scope_test.go cmd/compile: fix lexical scope of escaped variables 2017-07-10 20:09:00 +00:00
select.go cmd/compile: move Node.Typecheck to flags 2017-04-26 01:27:28 +00:00
shift_test.go cmd/compile: test non-constant shifts 2016-06-01 00:06:00 +00:00
sinit.go cmd/compile: avoid giant init functions due to many user inits 2017-05-01 18:00:11 +00:00
sizeof_test.go [dev.debug] cmd/compile: better DWARF with optimizations on 2017-07-27 20:19:44 +00:00
ssa.go runtime: remove link field from itab 2017-08-15 01:52:35 +00:00
ssa_test.go cmd/compile: fix s390x unsigned comparison constant merging rules 2017-04-13 18:35:11 +00:00
subr.go cmd/compile: remove some unused params in gc 2017-08-09 22:29:19 +00:00
swt.go runtime: remove link field from itab 2017-08-15 01:52:35 +00:00
swt_test.go cmd/compile: reduce reliance on implementation details of Mpint 2017-04-07 17:08:34 +00:00
syntax.go [dev.debug] cmd/compile: better DWARF with optimizations on 2017-07-27 20:19:44 +00:00
timings.go cmd/compile: add compiler phase timing 2016-08-17 17:27:04 +00:00
trace.go cmd/compile/internal/gc: add runtime/trace support 2016-10-12 13:57:26 +00:00
truncconst_test.go cmd/compile: diagnose constant division by complex zero 2017-04-12 17:29:28 +00:00
typecheck.go cmd/compile: remove some unused params in gc 2017-08-09 22:29:19 +00:00
types.go cmd/compile/internal/types: remove Cmptmp 2017-04-07 22:11:36 +00:00
types_acc.go cmd/compile: factor out Pkg, Sym, and Type into package types 2017-04-07 03:04:00 +00:00
universe.go cmd/compile: move Used from gc.Node to gc.Name 2017-04-27 22:58:13 +00:00
unsafe.go cmd/compile: handle unsafe builtins like universal builtins 2016-10-18 22:34:44 +00:00
util.go cmd/compile: add mutex profiling support 2017-04-05 22:10:54 +00:00
walk.go cmd/compile: generate makechan calls with int arguments 2017-08-15 05:54:24 +00:00