diff options
author | Ilya Tocar <ilya.tocar@intel.com> | 2018-06-27 11:40:24 -0500 |
---|---|---|
committer | Ilya Tocar <ilya.tocar@intel.com> | 2018-08-20 22:07:22 +0000 |
commit | 4201c2077ec3446a4fea5ed768c82aa96df69233 (patch) | |
tree | 24096efa6587c90599d2cfd1512cdf6fa36c3efb /src/cmd/compile/internal/ssa/config.go | |
parent | f76eaeb2c840c76c48dc53b834e9a0e005a70421 (diff) | |
download | go-4201c2077ec3446a4fea5ed768c82aa96df69233.tar.gz go-4201c2077ec3446a4fea5ed768c82aa96df69233.zip |
cmd/compile: omit racefuncentry/exit when they are not needed
When compiling with -race, we insert calls to racefuncentry,
into every function. Add a rule that removes them in leaf functions,
without instrumented loads/stores.
Shaves ~30kb from "-race" version of go tool:
file difference:
go_old 15626192
go_new 15597520 [-28672 bytes]
section differences:
global text (code) = -24513 bytes (-0.358598%)
read-only data = -5849 bytes (-0.167064%)
Total difference -30362 bytes (-0.097928%)
Fixes #24662
Change-Id: Ia63bf1827f4cf2c25e3e28dcd097c150994ade0a
Reviewed-on: https://go-review.googlesource.com/121235
Run-TryBot: Ilya Tocar <ilya.tocar@intel.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Keith Randall <khr@golang.org>
Diffstat (limited to 'src/cmd/compile/internal/ssa/config.go')
-rw-r--r-- | src/cmd/compile/internal/ssa/config.go | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/src/cmd/compile/internal/ssa/config.go b/src/cmd/compile/internal/ssa/config.go index af8cccff90..40008bcf87 100644 --- a/src/cmd/compile/internal/ssa/config.go +++ b/src/cmd/compile/internal/ssa/config.go @@ -38,6 +38,7 @@ type Config struct { nacl bool // GOOS=nacl use387 bool // GO386=387 SoftFloat bool // + Race bool // race detector enabled NeedsFpScratch bool // No direct move between GP and FP register sets BigEndian bool // } |