1
0
mirror of https://github.com/golang/go synced 2024-09-29 19:14:28 -06:00
The Go programming language
Go to file
Josh Bleecher Snyder ea3bfba87c cmd/compile: handle more cases in isNonNegative
The gains from this aren't particularly impressive.
Still, it is cheap and easy, and
it will keep me from wondering about whether it
might help to add X every time I look at this function.

This updated function is pretty exhaustive;
I examined every op encountered in a call to isNonNegative
when compiling all the stuff hanging around in my GOPATH,
for both 386 and amd64.

(32 bit architectures were somewhat neglected before.)

Object file size impact, 64 bit:

file                       before    after     Δ       %       
archive/zip.a              359352    359284    -68     -0.019% 
cmd/compile/internal/ssa.a 30715960  30717526  +1566   +0.005% 
cmd/internal/obj/arm64.a   2972532   2972440   -92     -0.003% 
cmd/internal/obj/riscv.a   297714    297672    -42     -0.014% 
debug/dwarf.a              656336    655346    -990    -0.151% 
debug/gosym.a              183352    183122    -230    -0.125% 
encoding/gob.a             901130    900798    -332    -0.037% 
image/gif.a                171884    171890    +6      +0.003% 
internal/trace.a           506930    507270    +340    +0.067% 
math.a                     233506    233490    -16     -0.007% 
reflect.a                  1431740   1431476   -264    -0.018% 
runtime.a                  3854480   3854332   -148    -0.004% 
unicode/utf16.a            8920      8980      +60     +0.673% 
total                      133000610 133000400 -210    -0.000% 

Object file size impact, 32 bit:

file                                          before    after     Δ       %       
archive/zip.a                                 330794    329640    -1154   -0.349% 
cmd/compile/internal/gc.a                     8090204   8090026   -178    -0.002% 
cmd/compile/internal/ssa.a                    29392460  29393890  +1430   +0.005% 
cmd/internal/goobj2.a                         189512    189492    -20     -0.011% 
cmd/internal/obj/arm64.a                      2444942   2444860   -82     -0.003% 
cmd/internal/obj/riscv.a                      272848    272806    -42     -0.015% 
cmd/link/internal/loader.a                    388548    388544    -4      -0.001% 
cmd/link/internal/loadpe.a                    158776    158684    -92     -0.058% 
cmd/vendor/golang.org/x/arch/ppc64/ppc64asm.a 511824    511316    -508    -0.099% 
cmd/vendor/golang.org/x/arch/x86/x86asm.a     512812    512704    -108    -0.021% 
cmd/vendor/golang.org/x/sys/unix.a            942422    942218    -204    -0.022% 
compress/bzip2.a                              88768     88680     -88     -0.099% 
crypto/tls.a                                  1655542   1655396   -146    -0.009% 
debug/dwarf.a                                 608520    605822    -2698   -0.443% 
debug/gosym.a                                 168282    168276    -6      -0.004% 
debug/pe.a                                    173146    173108    -38     -0.022% 
encoding/gob.a                                797978    797724    -254    -0.032% 
encoding/hex.a                                44080     44020     -60     -0.136% 
image/gif.a                                   152142    152148    +6      +0.004% 
internal/xcoff.a                              186480    185834    -646    -0.346% 
math.a                                        257866    257854    -12     -0.005% 
net/http.a                                    3588246   3588150   -96     -0.003% 
net/textproto.a                               162384    162120    -264    -0.163% 
reflect.a                                     1316204   1316058   -146    -0.011% 
regexp.a                                      373346    373248    -98     -0.026% 
runtime/pprof.a                               345318    345088    -230    -0.067% 
runtime.a                                     3513902   3513714   -188    -0.005% 
syscall.a                                     781406    781018    -388    -0.050% 
time.a                                        483814    483750    -64     -0.013% 
unicode/utf16.a                               8394      8364      -30     -0.357% 
vendor/golang.org/x/crypto/cryptobyte.a       287100    286706    -394    -0.137% 
vendor/golang.org/x/net/route.a               175042    174724    -318    -0.182% 
total                                         121677354 121670234 -7120   -0.006% 

Change-Id: Ie672752feb5e94dd151836f852181980710e820d
Reviewed-on: https://go-review.googlesource.com/c/go/+/212777
Run-TryBot: Josh Bleecher Snyder <josharian@gmail.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Keith Randall <khr@golang.org>
2020-02-27 16:38:23 +00:00
.github .github: add link to questions in ISSUE_TEMPLATE 2020-01-06 17:05:31 +00:00
api sync: add new Map method LoadAndDelete 2020-02-25 14:31:55 +00:00
doc cmd/go/internal/{test,vet}: use a standard flag.FlagSet to parse flags 2020-02-25 20:54:34 +00:00
lib/time lib/time: update tz data to 2019c 2019-11-26 12:03:08 +00:00
misc misc/wasm: avoid implicit boolean to number conversion 2020-02-25 21:08:47 +00:00
src cmd/compile: handle more cases in isNonNegative 2020-02-27 16:38:23 +00:00
test test: re-enable open-coded defer test on riscv64 2020-02-26 16:54:17 +00:00
.gitattributes
.gitignore .gitignore: ignore src/cmd/dist/dist 2017-10-28 21:55:49 +00:00
AUTHORS A+C: change email address for Akhil Indurti 2019-09-09 15:30:38 +00:00
CONTRIBUTING.md all: restore changes from faulty merge/revert 2018-02-12 20:13:59 +00:00
CONTRIBUTORS CONTRIBUTORS: second round of updates for Go 1.14 2020-02-21 19:59:34 +00:00
favicon.ico
LICENSE
PATENTS
README.md README: linkify some paths 2018-06-06 18:07:01 +00:00
robots.txt
SECURITY.md SECURITY.md: update go versions 2019-09-26 15:34:57 +00:00

The Go Programming Language

Go is an open source programming language that makes it easy to build simple, reliable, and efficient software.

Gopher image Gopher image by Renee French, licensed under Creative Commons 3.0 Attributions license.

Our canonical Git repository is located at https://go.googlesource.com/go. There is a mirror of the repository at https://github.com/golang/go.

Unless otherwise noted, the Go source files are distributed under the BSD-style license found in the LICENSE file.

Download and Install

Binary Distributions

Official binary distributions are available at https://golang.org/dl/.

After downloading a binary release, visit https://golang.org/doc/install or load doc/install.html in your web browser for installation instructions.

Install From Source

If a binary distribution is not available for your combination of operating system and architecture, visit https://golang.org/doc/install/source or load doc/install-source.html in your web browser for source installation instructions.

Contributing

Go is the work of thousands of contributors. We appreciate your help!

To contribute, please read the contribution guidelines: https://golang.org/doc/contribute.html

Note that the Go project uses the issue tracker for bug reports and proposals only. See https://golang.org/wiki/Questions for a list of places to ask questions about the Go language.