From 36694064e52c721b337f882473280b7da8282d1f Mon Sep 17 00:00:00 2001 From: Josh Bleecher Snyder Date: Mon, 4 May 2015 18:16:50 -0700 Subject: [PATCH] cmd/compile: disable checknils during alg eq generation Cuts 20k off cmd/go and 32k off golang.org/x/tools/cmd/godoc, approx 0.15% each. For #6853 and #9930 Change-Id: Ic510b76b80a9153b1ede7b3533d2dbc16caa5c63 Reviewed-on: https://go-review.googlesource.com/19768 TryBot-Result: Gobot Gobot Reviewed-by: David Crawshaw --- src/cmd/compile/internal/gc/subr.go | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/src/cmd/compile/internal/gc/subr.go b/src/cmd/compile/internal/gc/subr.go index f48b7cdc4f..bda1c95137 100644 --- a/src/cmd/compile/internal/gc/subr.go +++ b/src/cmd/compile/internal/gc/subr.go @@ -2862,10 +2862,18 @@ func geneq(sym *Sym, t *Type) { // for a struct containing a reflect.Value, which itself has // an unexported field of type unsafe.Pointer. old_safemode := safemode - safemode = 0 + + // Disable checknils while compiling this code. + // We are comparing a struct or an array, + // neither of which can be nil, and our comparisons + // are shallow. + Disable_checknil++ + funccompile(fn) + safemode = old_safemode + Disable_checknil-- } func ifacelookdot(s *Sym, t *Type, followptr *bool, ignorecase int) *Type { -- 2.50.0