aboutsummaryrefslogtreecommitdiff
path: root/src/cmd/compile/internal/test
AgeCommit message (Collapse)Author
2021-07-08[dev.typeparams] cmd/compile: cleanup ABI utils testsMatthew Dempsky
This CL cleans a few minor nits with the ABI utils tests that are now necessary because of cleanups that happened on master: 1. Initialize types.LocalPkg; this needs to be set for selector names to be handled correctly. 2. In TestABIUtilsInterfaces, switch to using an exported identifier, so it doesn't need to be package qualified. 3. While here, change the method result type from "untyped string" to just "string". Constants are the only declared object that can ever have an untyped type. Change-Id: Iabed46594361a516317a1c2d20c3d59bdb519844 Reviewed-on: https://go-review.googlesource.com/c/go/+/333189 Trust: Matthew Dempsky <mdempsky@google.com> Run-TryBot: Matthew Dempsky <mdempsky@google.com> TryBot-Result: Go Bot <gobot@golang.org> Reviewed-by: Than McIntosh <thanm@google.com>
2021-06-29[dev.typeparams] cmd/compile: add a field (method) name for function in ↵Dan Scales
TestABIUtilsInterfaces Not having a field name for the method is not really correct, and makes it look like an embedded field. In fact, currently types.CalcSize() in abitest() is creating an error that is not actually reported. Change-Id: I98c3a4abf5b6d610d9c3c56ce1042078374b5417 Reviewed-on: https://go-review.googlesource.com/c/go/+/331469 Run-TryBot: Dan Scales <danscales@google.com> TryBot-Result: Go Bot <gobot@golang.org> Trust: Dan Scales <danscales@google.com> Reviewed-by: Than McIntosh <thanm@google.com>
2021-06-11[dev.typeparams] runtime: simplify defer record allocationCherry Mui
Now that deferred functions are always argumentless and defer records are no longer with arguments, defer record can be fixed size (just the _defer struct). This allows us to simplify the allocation of defer records, specifically, remove the defer classes and the pools of different sized defers. Change-Id: Icc4b16afc23b38262ca9dd1f7369ad40874cf701 Reviewed-on: https://go-review.googlesource.com/c/go/+/326062 Trust: Cherry Mui <cherryyz@google.com> Run-TryBot: Cherry Mui <cherryyz@google.com> Reviewed-by: Michael Knyszek <mknyszek@google.com> TryBot-Result: Go Bot <gobot@golang.org>
2021-06-08[dev.typeparams] runtime: remove variadic defer/go callsCherry Mui
Now that defer/go wrapping is used, deferred/go'd functions are always argumentless. Remove the code handling arguments. This CL is mostly removing the fallback code path. There are more cleanups to be done, in later CLs. Change-Id: I87bfd3fb2d759fbeb6487b8125c0f6992863d6e5 Reviewed-on: https://go-review.googlesource.com/c/go/+/325915 Trust: Cherry Mui <cherryyz@google.com> Run-TryBot: Cherry Mui <cherryyz@google.com> TryBot-Result: Go Bot <gobot@golang.org> Reviewed-by: Michael Knyszek <mknyszek@google.com>
2021-05-25[dev.typeparams] all: merge master (f22ec51) into dev.typeparamsMatthew Dempsky
Merge List: + 2021-05-25 f22ec51deb doc: add Go 1.17 release note about inlining functions with closures + 2021-05-25 8b462d7567 cmd/go: add a -compat flag to 'go mod tidy' + 2021-05-24 c89f1224a5 net: verify results from Lookup* are valid domain names + 2021-05-24 08a8fa9c47 misc/wasm: ensure correct stack pointer in catch clauses + 2021-05-24 32b73ae180 cmd/go: align checks of module path during initialization. + 2021-05-24 15d9d4a009 cmd/go: add tests illustrating what happens when Go 1.16 is used in a Go 1.17 main module + 2021-05-24 873401df5b cmd/compile: ensure equal functions don't do unaligned loads + 2021-05-24 b83610699a cmd/compile: record regabi status in DW_AT_producer + 2021-05-24 a22e317220 cmd/compile: always include underlying type for map types + 2021-05-24 4356e7e85f runtime: account for spill slots in Windows callback compilation + 2021-05-24 52d7033ff6 cmd/go/internal/modload: set the default GoVersion in a single location + 2021-05-24 05819bc104 cmd/go/internal/modcmd: factor out a type for flags whose arguments are Go versions + 2021-05-22 cca23a7373 cmd/compile: revert CL/316890 + 2021-05-21 f87194cbd7 doc/go1.17: document changes to net/http package + 2021-05-21 217f5dd496 doc: document additional atomic.Value methods + 2021-05-21 3c656445f1 cmd/go: in TestScript/mod_replace, download an explicit module path + 2021-05-21 76b2d6afed os: document that StartProcess puts files into blocking mode + 2021-05-21 e4d7525c3e cmd/dist: display first class port status in json output + 2021-05-21 4fb10b2118 cmd/go: in 'go mod download' without args, don't save module zip sums + 2021-05-21 4fda54ce3f doc/go1.17: document database/sql changes for Go 1.17 + 2021-05-21 8876b9bd6a doc/go1.17: document io/fs changes for Go 1.17 + 2021-05-21 5fee772c87 doc/go1.17: document archive/zip changes for Go 1.17 + 2021-05-21 3148694f60 cmd/go: remove warning from module deprecation notice printing + 2021-05-21 7e63c8b765 runtime: wait for Go runtime to initialize in Windows signal test + 2021-05-21 831573cd21 io/fs: added an example for io/fs.WalkDir + 2021-05-20 baa934d26d cmd: go get golang.org/x/tools/analysis@49064d23 && go mod vendor + 2021-05-20 7c692cc7ea doc/go1.17: document changes to os package + 2021-05-20 ce9a3b79d5 crypto/x509: add new FreeBSD 12.2+ trusted certificate folder + 2021-05-20 f8be906d74 test: re-enable test on riscv64 now that it supports external linking + 2021-05-20 def5360541 doc/go1.17: add release notes for OpenBSD ports + 2021-05-20 ef1f52cc38 doc/go1.17: add release note for windows/arm64 port + 2021-05-20 bb7495a46d doc/go1.17: document new math constants + 2021-05-20 f07e4dae3c syscall: document NewCallback and NewCallbackCDecl limitations + 2021-05-20 a8d85918b6 misc/cgo/testplugin: skip TestIssue25756pie on darwin/arm64 builder + 2021-05-19 6c1c055d1e cmd/internal/moddeps: use filepath.SkipDir only on directories + 2021-05-19 658b5e66ec net: return nil UDPAddr from ReadFromUDP + 2021-05-19 15a374d5c1 test: check portable error message on issue46234.go + 2021-05-18 eeadce2d87 go/build/constraint: fix parsing of "// +build" (with no args) + 2021-05-18 6d2ef2ef2a cmd/compile: don't emit inltree for closure within body of inlined func + 2021-05-18 048cb4ceee crypto/x509: remove duplicate import Change-Id: Ib0442e3555493805f2aa1df26dfd6898df989a37
2021-05-24cmd/compile: ensure equal functions don't do unaligned loadsKeith Randall
On architectures which don't support unaligned loads, make sure we don't generate code that requires them. Generated hash functions also matter in this respect, but they all look ok. Update #37716 Fixes #46283 Change-Id: I6197fdfe04da4428092c99bd871d93738789e16b Reviewed-on: https://go-review.googlesource.com/c/go/+/322151 Trust: Keith Randall <khr@golang.org> Trust: Josh Bleecher Snyder <josharian@gmail.com> Run-TryBot: Keith Randall <khr@golang.org> Reviewed-by: Cherry Mui <cherryyz@google.com> Reviewed-by: Josh Bleecher Snyder <josharian@gmail.com> Reviewed-by: eric fang <eric.fang@arm.com> TryBot-Result: Go Bot <gobot@golang.org>
2021-05-21[dev.typeparams] runtime: replace funcPC with internal/abi.FuncPCABIInternalCherry Mui
At this point all funcPC references are ABIInternal functions. Replace with the intrinsics. Change-Id: I3ba7e485c83017408749b53f92877d3727a75e27 Reviewed-on: https://go-review.googlesource.com/c/go/+/321954 Trust: Cherry Mui <cherryyz@google.com> Run-TryBot: Cherry Mui <cherryyz@google.com> TryBot-Result: Go Bot <gobot@golang.org> Reviewed-by: Michael Knyszek <mknyszek@google.com>
2021-05-08cmd/compile: remove bit operations that modify memory directlyKeith Randall
These operations (BT{S,R,C}{Q,L}modify) are quite a bit slower than other ways of doing the same thing. Without the BTxmodify operations, there are two fallback ways the compiler performs these operations: AND/OR/XOR operations directly on memory, or load-BTx-write sequences. The compiler kinda chooses one arbitrarily depending on rewrite rule application order. Currently, it uses load-BTx-write for the Const benchmarks and AND/OR/XOR directly to memory for the non-Const benchmarks. TBD, someone might investigate which of the two fallback strategies is really better. For now, they are both better than BTx ops. name old time/op new time/op delta BitSet-8 1.09µs ± 2% 0.64µs ± 5% -41.60% (p=0.000 n=9+10) BitClear-8 1.15µs ± 3% 0.68µs ± 6% -41.00% (p=0.000 n=10+10) BitToggle-8 1.18µs ± 4% 0.73µs ± 2% -38.36% (p=0.000 n=10+8) BitSetConst-8 37.0ns ± 7% 25.8ns ± 2% -30.24% (p=0.000 n=10+10) BitClearConst-8 30.7ns ± 2% 25.0ns ±12% -18.46% (p=0.000 n=10+10) BitToggleConst-8 36.9ns ± 1% 23.8ns ± 3% -35.46% (p=0.000 n=9+10) Fixes #45790 Update #45242 Change-Id: Ie33a72dc139f261af82db15d446cd0855afb4e59 Reviewed-on: https://go-review.googlesource.com/c/go/+/318149 Trust: Keith Randall <khr@golang.org> Run-TryBot: Keith Randall <khr@golang.org> TryBot-Result: Go Bot <gobot@golang.org> Reviewed-by: Ben Shi <powerman1st@163.com>
2021-04-30cmd/compile: handle field padding for register-passed structsThan McIntosh
When constructing multi-piece DWARF location expressions for struct-typed parameters using the register ABI, make sure that the location expressions generated properly reflect padding between elements (this is required by debuggers). Example: type small struct { x uint16 ; y uint8 ; z int32 } func ABC(p1 int, p2 small, f1 float32) { ... In the DWARF location expression for "p2" on entry to the routine, we need pieces for each field, but for debuggers (such as GDB) to work properly, we also need to describe the padding between elements. Thus instead of <rbx> DW_OP_piece 2 <rcx> DW_OP_piece 1 <rdi> DW_OP_piece 4 we need to emit <rbx> DW_OP_piece 2 <rcx> DW_OP_piece 1 DW_OP_piece 1 <rdi> DW_OP_piece 4 This patch adds a new helper routine in abiutils to compute the correct padding amounts for a struct type, a unit test for the helper, and updates the debug generation code to call the helper and insert apadding "piece" ops in the right spots. Updates #40724. Updates #45720. Change-Id: Ie208bee25776b9eb70642041869e65e4fa65a005 Reviewed-on: https://go-review.googlesource.com/c/go/+/315071 Trust: Than McIntosh <thanm@google.com> Run-TryBot: Than McIntosh <thanm@google.com> TryBot-Result: Go Bot <gobot@golang.org> Reviewed-by: David Chase <drchase@google.com>
2021-04-12cmd/compile/internal/amd64: follow-on regabi fix for amd64 zerorangeThan McIntosh
This patch provides a better long-term fix for the compiler's zerorange() helper function to make it generate code friendly to the register ABI. CL 305829 did part of the work, but didn't properly handle the case where the compiler emits a REP.STOSQ sequence; this patch changes the REP code to make sure it doesn't clobber any incoming register parameter values. Also included is a test that is specifically written to trigger the REP emit code in the compiler (prior to this, this code was not being hit on linux/amd64 all.bash). Updates #45372. Updates #40724. Change-Id: Iaf1c4e709e98eda45cd6f3aeebda0fe9160f1f42 Reviewed-on: https://go-review.googlesource.com/c/go/+/307829 Trust: Than McIntosh <thanm@google.com> Run-TryBot: Than McIntosh <thanm@google.com> Reviewed-by: Cherry Zhang <cherryyz@google.com>
2021-04-12runtime: using wyhash for memhashFallback on 64bit platformMeng Zhuo
wyhash is a general hash function that: 1. About 8-70% faster that internal maphash 2. Passed Smhasher, BigCrush and PractRand tests name old time/op new time/op delta Hash5 28.9ns ± 0% 30.0ns ± 0% +3.77% (p=0.000 n=9+10) Hash16 32.4ns ± 0% 30.2ns ± 0% -6.74% (p=0.000 n=10+8) Hash64 52.4ns ± 0% 43.4ns ± 0% -17.20% (p=0.000 n=9+10) Hash1024 415ns ± 0% 258ns ± 2% -37.89% (p=0.000 n=10+10) Hash65536 24.9µs ± 0% 14.6µs ± 0% -41.22% (p=0.000 n=9+9) HashStringSpeed 50.2ns ± 4% 47.8ns ± 4% -4.88% (p=0.000 n=10+10) HashBytesSpeed 90.1ns ± 7% 78.3ns ± 4% -13.06% (p=0.000 n=10+10) HashInt32Speed 33.3ns ± 6% 33.6ns ± 4% ~ (p=0.071 n=10+10) HashInt64Speed 32.7ns ± 3% 34.0ns ± 3% +4.05% (p=0.000 n=9+10) HashStringArraySpeed 131ns ± 2% 117ns ± 5% -10.32% (p=0.000 n=9+10) FastrandHashiter 72.2ns ± 1% 75.7ns ±10% +4.87% (p=0.019 n=8+10) name old speed new speed delta Hash5 173MB/s ± 0% 167MB/s ± 0% -3.63% (p=0.000 n=9+10) Hash16 494MB/s ± 0% 530MB/s ± 0% +7.23% (p=0.000 n=10+8) Hash64 1.22GB/s ± 0% 1.48GB/s ± 0% +20.77% (p=0.000 n=9+10) Hash1024 2.47GB/s ± 0% 3.97GB/s ± 2% +61.01% (p=0.000 n=8+10) Hash65536 2.64GB/s ± 0% 4.48GB/s ± 0% +70.13% (p=0.000 n=9+9) Change-Id: I76af4e2bc1995a18149d11983ea8a149c132865e Reviewed-on: https://go-review.googlesource.com/c/go/+/279612 Trust: Meng Zhuo <mzh@golangcn.org> Run-TryBot: Meng Zhuo <mzh@golangcn.org> TryBot-Result: Go Bot <gobot@golang.org> Reviewed-by: Keith Randall <khr@golang.org>
2021-03-23cmd/compile/internal/test: update abi tests for recent spec changesThan McIntosh
The internal ABI spec was recently updated to include specific language covering "past-the-end" pointers and structs containing trailing zero-sized fields. Add a unit test that makes sure we do the right thing in this case. Fix a couple comments in other unit tests. Change-Id: I18d373d11e122aec74b316837843887272676c63 Reviewed-on: https://go-review.googlesource.com/c/go/+/303809 Trust: Than McIntosh <thanm@google.com> Run-TryBot: Than McIntosh <thanm@google.com> TryBot-Result: Go Bot <gobot@golang.org> Reviewed-by: David Chase <drchase@google.com>
2021-03-23cmd/compile: optimize codes with arm64 REV16 instructionfanzha02
Optimize some patterns into rev16/rev16w instruction. Pattern1: (c & 0xff00ff00)>>8 | (c & 0x00ff00ff)<<8 To: rev16w c Pattern2: (c & 0xff00ff00ff00ff00)>>8 | (c & 0x00ff00ff00ff00ff)<<8 To: rev16 c This patch is a copy of CL 239637, contributed by Alice Xu(dianhong.xu@arm.com). Change-Id: I96936c1db87618bc1903c04221c7e9b2779455b3 Reviewed-on: https://go-review.googlesource.com/c/go/+/268377 Trust: fannie zhang <Fannie.Zhang@arm.com> Run-TryBot: fannie zhang <Fannie.Zhang@arm.com> TryBot-Result: Go Bot <gobot@golang.org> Reviewed-by: Cherry Zhang <cherryyz@google.com>
2021-03-19cmd/compile: add clobberdeadreg modeCherry Zhang
When -clobberdeadreg flag is set, the compiler inserts code that clobbers integer registers at call sites. This may be helpful for debugging register ABI. Only implemented on AMD64 for now. Change-Id: Ia203d3f891c30fd95d0103489056fe01d63a2899 Reviewed-on: https://go-review.googlesource.com/c/go/+/302809 Trust: Cherry Zhang <cherryyz@google.com> Run-TryBot: Cherry Zhang <cherryyz@google.com> TryBot-Result: Go Bot <gobot@golang.org> Reviewed-by: David Chase <drchase@google.com>
2021-03-17cmd/compile: resurrect clobberdead modeCherry Zhang
This CL resurrects the clobberdead debugging mode (CL 23924). When -clobberdead flag is set (TODO: make it GOEXPERIMENT?), the compiler inserts code that clobbers all dead stack slots that contains pointers. Mark windows syscall functions cgo_unsafe_args, as the code actually does that, by taking the address of one argument and passing it to cgocall. Change-Id: Ie09a015f4bd14ae6053cc707866e30ae509b9d6f Reviewed-on: https://go-review.googlesource.com/c/go/+/301791 Trust: Cherry Zhang <cherryyz@google.com> Run-TryBot: Cherry Zhang <cherryyz@google.com> TryBot-Result: Go Bot <gobot@golang.org> Reviewed-by: David Chase <drchase@google.com> Reviewed-by: Than McIntosh <thanm@google.com>
2021-03-16cmd/compile: (fixed) spill output parameters passed in registers as autosDavid Chase
Repair of CL 300749. ALSO: found evidence that stack maps for bodyless methods are wrong. gofmt in test/abi removed never-executed code in types/size.go Updates #44816. Updates #40724. Change-Id: Ifeb5fee60f60e7c7b58ee0457f58a3265d6cf3f6 Reviewed-on: https://go-review.googlesource.com/c/go/+/302071 Trust: David Chase <drchase@google.com> Reviewed-by: Cherry Zhang <cherryyz@google.com>
2021-03-15Revert "cmd/compile: spill output parameters passed in registers as autos"David Chase
This reverts commit 8ed438c077d82c4b4662c327dbbdb3c64e7547ca, CL 300749. Reason for revert: Looks like it crashes on link-register architectures Change-Id: I0c261df58900008cada3359889d2a87508158447 Reviewed-on: https://go-review.googlesource.com/c/go/+/302053 Reviewed-by: Michael Knyszek <mknyszek@google.com> Reviewed-by: Cherry Zhang <cherryyz@google.com>
2021-03-15cmd/compile: spill output parameters passed in registers as autosDavid Chase
ALSO: found evidence that stack maps for bodyless methods are wrong. gofmt in test/abi removed never-executed code in types/size.go Updates #44816. Change-Id: I658c33f049337fb6f1e625f0c55430d25bfa877e Reviewed-on: https://go-review.googlesource.com/c/go/+/300749 Trust: David Chase <drchase@google.com> Run-TryBot: David Chase <drchase@google.com> TryBot-Result: Go Bot <gobot@golang.org> Reviewed-by: Cherry Zhang <cherryyz@google.com>
2021-03-15net: use mid-stack inlining with ReadFromUDP to avoid an allocationJosh Bleecher Snyder
This commit rewrites ReadFromUDP to be mid-stack inlined and pass a UDPAddr for lower layers to fill in. This lets performance-sensitive clients avoid an allocation. It requires some care on their part to prevent the UDPAddr from escaping, but it is now possible. The UDPAddr trivially does not escape in the benchmark, as it is immediately discarded. name old time/op new time/op delta WriteToReadFromUDP-8 17.2µs ± 6% 17.1µs ± 5% ~ (p=0.387 n=9+9) name old alloc/op new alloc/op delta WriteToReadFromUDP-8 112B ± 0% 64B ± 0% -42.86% (p=0.000 n=10+10) name old allocs/op new allocs/op delta WriteToReadFromUDP-8 3.00 ± 0% 2.00 ± 0% -33.33% (p=0.000 n=10+10) Updates #43451 Co-authored-by: Filippo Valsorda <filippo@golang.org> Change-Id: I1f9d2ab66bd7e4eff07fe39000cfa0b45717bd13 Reviewed-on: https://go-review.googlesource.com/c/go/+/291509 Run-TryBot: Filippo Valsorda <filippo@golang.org> TryBot-Result: Go Bot <gobot@golang.org> Reviewed-by: Josh Bleecher Snyder <josharian@gmail.com> Reviewed-by: Jason A. Donenfeld <Jason@zx2c4.com> Trust: Filippo Valsorda <filippo@golang.org> Trust: Josh Bleecher Snyder <josharian@gmail.com> Trust: Jason A. Donenfeld <Jason@zx2c4.com>
2021-03-09cmd/compile: fix failure to communicate between ABIinfo producer&consumerDavid Chase
ABI info producer and consumer had different ideas for register order for parameters. Includes a test, includes improvements to debugging output. Updates #44816. Change-Id: I4812976f7a6c08d6fc02aac1ec0544b1f141cca6 Reviewed-on: https://go-review.googlesource.com/c/go/+/299570 Trust: David Chase <drchase@google.com> Reviewed-by: Than McIntosh <thanm@google.com>
2021-03-02cmd/compile: better version of check frame offsets against abiDavid Chase
improved to run on more architectures. this is in preparation for turning off calculation of frame offsets in types.CalcSize. Replaces https://go-review.googlesource.com/c/go/+/293392 . Updates #44675. For #40724. Change-Id: I40ba496172447cf09b86bc646148859363c11ad9 Reviewed-on: https://go-review.googlesource.com/c/go/+/297637 Trust: David Chase <drchase@google.com> Run-TryBot: David Chase <drchase@google.com> TryBot-Result: Go Bot <gobot@golang.org> Reviewed-by: Cherry Zhang <cherryyz@google.com>
2021-03-01Revert "cmd/compile: check frame offsets against abi"Bryan C. Mills
This reverts CL 293392. Reason for revert: broke most non-x86 builders Fixes #44675 Change-Id: I1e815c3ab27a02e83a2f0d221a617909dd021403 Reviewed-on: https://go-review.googlesource.com/c/go/+/297549 Trust: Bryan C. Mills <bcmills@google.com> Run-TryBot: Bryan C. Mills <bcmills@google.com> TryBot-Result: Go Bot <gobot@golang.org> Reviewed-by: Jeremy Faller <jeremy@golang.org>
2021-02-27cmd/compile: check frame offsets against abiDavid Chase
this is in preparation for turning off calculation of frame offsets in types.CalcSize For #40724. Change-Id: I2c29fd289c014674076e5ec5170055dbca5ea64b Reviewed-on: https://go-review.googlesource.com/c/go/+/293392 Trust: David Chase <drchase@google.com> Run-TryBot: David Chase <drchase@google.com> TryBot-Result: Go Bot <gobot@golang.org> Reviewed-by: Jeremy Faller <jeremy@golang.org>
2021-02-19[dev.typeparams] all: merge master (06b86e9) into dev.typeparamsRobert Griesemer
Merge List: + 2021-02-19 06b86e9803 cmd/compile: fix check to avoid creating new closure function when typechecking inline body + 2021-02-19 9322eec8a2 codereview.cfg: add codereview.cfg for master branch + 2021-02-19 02e5a8fdfc runtime: ignore SPWRITE in syscall functions + 2021-02-19 fa18f224c3 runtime/pprof: disable TestMorestack on macOS under race detector + 2021-02-19 01eb70e3dd os: fix hex exit code print on 32-bit windows + 2021-02-19 49add6ad90 runtime: fix spurious stack overflow detection + 2021-02-19 fce2a94d84 cmd/compile: fix buglet in inlined info abstract function dwarf-gen + 2021-02-19 7764ee5614 runtime: fix invalid nil g check for for mips64x + 2021-02-19 87f425da14 cmd/go/internal/mvs: split Reqs into narrower per-function interfaces + 2021-02-19 4da0188c6c cmd/go/internal/modget: split resolveCandidates into two methods + 2021-02-19 5f2e24efb3 cmd/internal/diff: skip over Cygwin warning in diff output + 2021-02-19 ee7038f6a5 net: disable Windows netsh tests when netsh won't run + 2021-02-19 40765ffa95 os/exec: disable failing LookPathTest on windows/arm64 + 2021-02-19 b445d6ea34 runtime/pprof: expect tests to pass on macOS + 2021-02-19 b110a43628 runtime: delete gosave (dead code) + 2021-02-19 474d5f4f4d math: remove most 387 implementations + 2021-02-19 c7c6c113be runtime: convert windows/arm64 assembly + 2021-02-19 3527caa7d6 runtime: initial windows/arm64 implementation files + 2021-02-19 427bd7599d runtime: generate windows/arm64 callback asm + 2021-02-19 f6c4b4bf96 syscall: add windows/arm64 support + 2021-02-19 ac024a0c7b cmd/vendor: get golang.org/x/sys@beda7e5e158 + 2021-02-19 a3b97e7628 test: disable nilptr on windows/arm64 + 2021-02-19 985d087782 cmd/link: add windows/arm64 support + 2021-02-19 95a44d2409 cmd/internal/objfile: recognize Windows ARM64 executables + 2021-02-19 0ca0551f02 debug/pe: recognize arm64 executables + 2021-02-19 0c633125f2 cmd/dist: add windows/arm64 support + 2021-02-19 bb6efb9609 build: set GOPATH consistently in run.bash, run.bat, run.rc + 2021-02-19 a1222b7535 cmd/link: add debug print in deadcode + 2021-02-19 1c659f2525 cmd/link: clean up windows PE generation + 2021-02-19 b6379f190b syscall: clean up windows a bit + 2021-02-19 09e059afb1 runtime: enable framepointer on all arm64 + 2021-02-19 b19e7b518e runtime: clean up windows a bit + 2021-02-19 5421c37a1d runtime: fix windows/arm externalthreadhandler + 2021-02-19 91cc484ea9 runtime: fix time on windows/arm under WINE + 2021-02-19 38672d3dcf runtime: crash earlier on windows for runtime.abort + 2021-02-19 a1e9148e3d runtime: print hex numbers with hex prefixes in traceback debug + 2021-02-19 75e273fc2c runtime: fix windows/arm CONTEXT_CONTROL + 2021-02-19 76ab626bfc runtime: factor common code out of defs_windows_*.go + 2021-02-19 ece954d8b8 runtime: find g in Windows profiler using SP + 2021-02-19 a54f7fc0fd runtime: do not treat asmcgocall as a topofstack on g0 + 2021-02-19 776ee4079a runtime: do not treat morestack as a topofstack + 2021-02-19 5ecd9e34df runtime: do not treat mcall as a topofstack + 2021-02-19 54da3ab385 runtime: use TOPFRAME to identify top-of-frame functions + 2021-02-19 fbe74dbf42 runtime: use FuncInfo SPWRITE flag to identify untraceable profile samples + 2021-02-19 4dd77bdc91 cmd/asm, cmd/link, runtime: introduce FuncInfo flag bits + 2021-02-19 aa0388f2ed runtime: remove unnecessary writes to gp.sched.g + 2021-02-19 6fe8981620 cmd/internal/obj/riscv: fix JMP name<>(SB) + 2021-02-19 01f05d8ff1 runtime: unify asmcgocall and systemstack traceback setup + 2021-02-19 229695a283 runtime: clean up funcID assignment + 2021-02-19 c80da0a33a runtime: handle nil gp in cpuprof + 2021-02-19 a78879ac67 runtime: move sys.DefaultGoroot to runtime.defaultGOROOT + 2021-02-19 8ac23a1f15 runtime: document, clean up internal/sys + 2021-02-19 678568a5cf runtime: delete windows setlasterror (unused) + 2021-02-19 0d94f989d1 runtime: clean up system calls during cgo callback init + 2021-02-19 e7ee3c1fa8 os: report Windows exit status in hex Change-Id: Ib27e232dabac0604b588f27749bd8ad45a281fe3
2021-02-19cmd/asm, cmd/link, runtime: introduce FuncInfo flag bitsRuss Cox
The runtime traceback code has its own definition of which functions mark the top frame of a stack, separate from the TOPFRAME bits that exist in the assembly and are passed along in DWARF information. It's error-prone and redundant to have two different sources of truth. This CL provides the actual TOPFRAME bits to the runtime, so that the runtime can use those bits instead of reinventing its own category. This CL also adds a new bit, SPWRITE, which marks functions that write directly to SP (anything but adding and subtracting constants). Such functions must stop a traceback, because the traceback has no way to rederive the SP on entry. Again, the runtime has its own definition which is mostly correct, but also missing some functions. During ordinary goroutine context switches, such functions do not appear on the stack, so the incompleteness in the runtime usually doesn't matter. But profiling signals can arrive at any moment, and the runtime may crash during traceback if it attempts to unwind an SP-writing frame and gets out-of-sync with the actual stack. The runtime contains code to try to detect likely candidates but again it is incomplete. Deriving the SPWRITE bit automatically from the actual assembly code provides the complete truth, and passing it to the runtime lets the runtime use it. This CL is part of a stack adding windows/arm64 support (#36439), intended to land in the Go 1.17 cycle. This CL is, however, not windows/arm64-specific. It is cleanup meant to make the port (and future ports) easier. Change-Id: I227f53b23ac5b3dabfcc5e8ee3f00df4e113cf58 Reviewed-on: https://go-review.googlesource.com/c/go/+/288800 Trust: Russ Cox <rsc@golang.org> Trust: Jason A. Donenfeld <Jason@zx2c4.com> Reviewed-by: Cherry Zhang <cherryyz@google.com> Reviewed-by: Jason A. Donenfeld <Jason@zx2c4.com>
2021-02-17[dev.typeparams] merge master (2f0da6d) into dev.typeparamsRob Findley
This was a mostly clean merge, with the exception of codereview.cfg and changes in src/go/types. codereview.cfg for dev.typeparams is preserved in this CL. It should be deleted before merging back to master. The go/types changes were merged manually. For the most part this involved taking the union of patches, with the following exceptions: + declInfo.aliasPos is removed, as it is not necessary in dev.typeparams where we have access to the full TypeSpec. + Checker.overflow is updated to use the asBasic converter. + A TODO is added to errorcodes.go to ensure that go1.16 error codes are preserved. Change-Id: If9595196852e2163e27a9478df1e7b2c3704947d
2021-02-17cmd/compile/internal/test: gofmt abiutils_test.goCherry Zhang
Turns out that file is not formatted properly in the dev.regabi branch. Change-Id: I93125e65d5d3e8448c6ec1f077332c9bf7f0dd26 Reviewed-on: https://go-review.googlesource.com/c/go/+/292594 Trust: Cherry Zhang <cherryyz@google.com> Reviewed-by: Jeremy Faller <jeremy@golang.org> Reviewed-by: Dmitri Shuralyov <dmitshur@golang.org>
2021-01-28[dev.typeparams] cmd/compile: start adding info needed for typeparams in ↵Dan Scales
types & ir We are focusing on generic functions first, and ignoring type lists for now. The signatures of types.NewSignature() and ir.NewCallExpr() changed (with addition of type args/params). Change-Id: I57480be3d1f65690b2946e15dd74929bf42873f2 Reviewed-on: https://go-review.googlesource.com/c/go/+/287416 Reviewed-by: Robert Griesemer <gri@golang.org> Trust: Robert Griesemer <gri@golang.org> Trust: Dan Scales <danscales@google.com>
2021-01-25[dev.typeparams] all: merge dev.regabi (5e4a0cd) into dev.typeparamsMatthew Dempsky
Merge List: + 2021-01-25 5e4a0cdde3 [dev.regabi] all: merge master (bf0f7c9) into dev.regabi + 2021-01-25 bf0f7c9d78 doc/go1.16: mention os.DirFS in os section + 2021-01-25 deaf29a8a8 cmd/compile: fix order-of-assignment issue w/ defers + 2021-01-25 ad2ca26a52 doc/go1.16: mention os.DirEntry and types moved from os to io/fs + 2021-01-25 a51921fa5b doc/go1.16: mention new testing/iotest functions + 2021-01-25 e6b6d107f7 doc/go1.16: mention deprecation of io/ioutil + 2021-01-25 7eaaf28cae [dev.regabi] cmd/compile: disallow taking address of SSA'd values + 2021-01-25 96a276363b doc/go1.16: mention go/build changes + 2021-01-25 3d85c69a0b html/template: revert "avoid race when escaping updates template" + 2021-01-25 54514c6b28 cmd/go: fix TestScript/cgo_path, cgo_path_space when CC set + 2021-01-25 6f5e79f470 [dev.regabi] cmd/compile/internal: specify memory layout + 2021-01-25 cabffc199d [dev.regabi] cmd/compile/internal: add internal ABI specification + 2021-01-25 6de8443f3b doc/asm: add a section on go_asm.h, clean up go_tls.h section + 2021-01-25 6a4739ccc5 [dev.regabi] cmd/compile: enable rational constant arithmetic + 2021-01-25 be9612a832 [dev.regabi] os: disable TestDirFS until #42637 is fixed + 2021-01-25 8ee3d39838 [dev.regabi] cmd/go: workaround -race issue on ppc64le + 2021-01-25 54b251f542 lib/time, time/tzdata: update tzdata to 2021a + 2021-01-25 5a76c3d548 [dev.regabi] cmd/compile: modify abiutils for recently updated ABI + 2021-01-25 ff82cc971a os: force consistent mtime before running fstest on directory on Windows + 2021-01-25 044f937a73 doc/go1.16: fix WalkDir and Walk links + 2021-01-23 b634f5d97a doc/go1.16: add crypto/x509 memory optimization + 2021-01-23 9897655c61 doc/go1.16: reword ambiguously parsable sentence + 2021-01-23 cd99385ff4 cmd/internal/obj/arm64: fix VMOVQ instruction encoding error + 2021-01-23 66ee8b158f runtime: restore cgo_import_dynamic for libc.so on openbsd + 2021-01-22 25c39e4fb5 io/ioutil: fix example test for WriteFile to allow it to run in the playground + 2021-01-22 eb21b31e48 runtime: define dummy msanmove + 2021-01-22 3a778ff50f runtime: check for g0 stack last in signal handler + 2021-01-22 a2cef9b544 cmd/go: don't lookup the path for CC when invoking cgo Change-Id: Iede4f98ba5ddbee2e16075d20186f8a9c095e378
2021-01-25[dev.regabi] cmd/compile: modify abiutils for recently updated ABIDavid Chase
Discovered difficluties posed by earlier design, these modifications should work better. Updated tests, also added some helper functions for use in call lowering. Change-Id: I459f0f71ad8a6730c571244925c3f395e1df28de Reviewed-on: https://go-review.googlesource.com/c/go/+/285392 Trust: David Chase <drchase@google.com> Run-TryBot: David Chase <drchase@google.com> TryBot-Result: Go Bot <gobot@golang.org> Reviewed-by: Than McIntosh <thanm@google.com>
2021-01-22[dev.typeparams] all: merge dev.regabi (7e0a81d) into dev.typeparamsMatthew Dempsky
As with CL 285875, this required resolving some conflicts around handling of //go:embed directives. Still further work is needed to reject uses of //go:embed in files that don't import "embed", so this is left as a TODO. (When this code was written for dev.typeparams, we were still leaning towards not requiring the "embed" import.) Also, the recent support for inlining closures (CL 283112) interacts poorly with -G=3 mode. There are some known issues with this code already (#43818), so for now this CL disables inlining of closures when in -G=3 mode with a TODO to revisit this once closure inlining is working fully. Conflicts: - src/cmd/compile/internal/noder/noder.go - src/cmd/compile/internal/typecheck/dcl.go - src/cmd/compile/internal/typecheck/func.go - test/run.go Merge List: + 2021-01-22 7e0a81d280 [dev.regabi] all: merge master (dab3e5a) into dev.regabi + 2021-01-22 dab3e5affe runtime: switch runtime to libc for openbsd/amd64 + 2021-01-22 a1b53d85da cmd/go: add documentation for test and xtest fields output by go list + 2021-01-22 b268b60774 runtime: remove pthread_kill/pthread_self for openbsd + 2021-01-22 ec4051763d runtime: fix typo in mgcscavenge.go + 2021-01-22 7ece3a7b17 net/http: fix flaky TestDisableKeepAliveUpgrade + 2021-01-22 50cba0506f time: clarify Timer.Reset behavior on AfterFunc Timers + 2021-01-22 cf10e69f17 doc/go1.16: mention net/http.Transport.GetProxyConnectHeader + 2021-01-22 ec1b945265 doc/go1.16: mention path/filepath.WalkDir + 2021-01-22 11def3d40b doc/go1.16: mention syscall.AllThreadsSyscall + 2021-01-21 07b0235609 doc/go1.16: add notes about package-specific fs.FS changes + 2021-01-21 e2b4f1fea5 doc/go1.16: minor formatting fix + 2021-01-21 9f43a9e07b doc/go1.16: mention new debug/elf constants + 2021-01-21 3c2f11ba5b cmd/go: overwrite program name with full path + 2021-01-21 953d1feca9 all: introduce and use internal/execabs + 2021-01-21 b186e4d70d cmd/go: add test case for cgo CC setting + 2021-01-21 5a8a2265fb cmd/cgo: report exec errors a bit more clearly + 2021-01-21 46e2e2e9d9 cmd/go: pass resolved CC, GCCGO to cgo + 2021-01-21 3d40895e36 runtime: switch openbsd/arm64 to pthreads + 2021-01-21 d95ca91380 crypto/elliptic: fix P-224 field reduction + 2021-01-21 d7e71c01ad [dev.regabi] cmd/compile: replace ir.Name map with ir.NameSet for dwarf + 2021-01-21 5248f59a22 [dev.regabi] cmd/compile: replace ir.Name map with ir.NameSet for SSA + 2021-01-21 970d8b6cb2 [dev.regabi] cmd/compile: replace ir.Name map with ir.NameSet in inlining + 2021-01-21 68a4664475 [dev.regabi] cmd/compile: remove tempAssigns in walkCall1 + 2021-01-21 fd9a391cdd [dev.regabi] cmd/compile: remove CallExpr.Rargs + 2021-01-21 19a6db6b63 [dev.regabi] cmd/compile: make sure mkcall* passed non-nil init + 2021-01-21 9f036844db [dev.regabi] cmd/compile: use ir.DoChildren directly in inlining + 2021-01-21 213c3905e9 [dev.regabi] cmd/compile: use node walked flag to prevent double walk for walkSelect + 2021-01-20 1760d736f6 [dev.regabi] cmd/compile: exporting, importing, and inlining functions with OCLOSURE + 2021-01-20 ecf4ebf100 cmd/internal/moddeps: check content of all modules in GOROOT + 2021-01-20 92cb157cf3 [dev.regabi] cmd/compile: late expansion of return values + 2021-01-20 d2d155d1ae runtime: don't adjust timer pp field in timerWaiting status + 2021-01-20 803d18fc6c cmd/go: set Incomplete field on go list output if no files match embed + 2021-01-20 6e243ce71d cmd/go: have go mod vendor copy embedded files in subdirs + 2021-01-20 be28e5abc5 cmd/go: fix mod_get_fallback test + 2021-01-20 928bda4f4a runtime: convert openbsd/amd64 locking to libc + 2021-01-19 824f2d635c cmd/go: allow go fmt to complete when embedded file is missing + 2021-01-19 0575e35e50 cmd/compile: require 'go 1.16' go.mod line for //go:embed + 2021-01-19 9423d50d53 [dev.regabi] cmd/compile: use '%q' for printing rune values less than 128 + 2021-01-19 ccb2e90688 cmd/link: exit before Asmb2 if error + 2021-01-19 ca5774a5a5 embed: treat uninitialized FS as empty + 2021-01-19 d047c91a6c cmd/link,runtime: switch openbsd/amd64 to pthreads + 2021-01-19 61debffd97 runtime: factor out usesLibcall + 2021-01-19 9fed39d281 runtime: factor out mStackIsSystemAllocated + 2021-01-19 a2f825c542 [dev.regabi] cmd/compile: directly create go.map and go.track symbols + 2021-01-19 4a4212c0e5 [dev.regabi] cmd/compile: refactor Linksym creation + 2021-01-19 4f5c603c0f [dev.regabi] cmd/compile: cleanup callTargetLSym + 2021-01-18 dbab079835 runtime: free Windows event handles after last lock is dropped + 2021-01-18 5a8fbb0d2d os: do not close syscall.Stdin in TestReadStdin + 2021-01-18 422f38fb6c [dev.regabi] cmd/compile: move stack objects to liveness + 2021-01-18 6113db0bb4 [dev.regabi] cmd/compile: convert OPANIC argument to interface{} during typecheck + 2021-01-18 4c835f9169 [dev.regabi] cmd/compile: use LinksymOffsetExpr in TypePtr/ItabAddr + 2021-01-18 0ffa1ead6e [dev.regabi] cmd/compile: use *obj.LSym instead of *ir.Name for staticdata functions + 2021-01-17 7e0fa38aad [dev.regabi] cmd/compile: remove unneeded packages from ir.Pkgs + 2021-01-17 99a5db11ac [dev.regabi] cmd/compile: use LinksymOffsetExpr in walkConvInterface + 2021-01-17 87845d14f9 [dev.regabi] cmd/compile: add ir.TailCallStmt + 2021-01-17 e3027c6828 [dev.regabi] cmd/compile: fix linux-amd64-noopt builder + 2021-01-17 59ff93fe64 [dev.regabi] cmd/compile: rename NameOffsetExpr to LinksymOffsetExpr + 2021-01-17 82b9cae700 [dev.regabi] cmd/compile: change ir.NameOffsetExpr to use *obj.LSym instead of *Name + 2021-01-17 88956fc4b1 [dev.regabi] cmd/compile: stop analyze NameOffsetExpr.Name_ in escape analysis + 2021-01-17 7ce2a8383d [dev.regabi] cmd/compile: simplify stack temp initialization + 2021-01-17 ba0e8a92fa [dev.regabi] cmd/compile: refactor temp construction in walk + 2021-01-17 78e5aabcdb [dev.regabi] cmd/compile: replace Node.HasCall with walk.mayCall + 2021-01-16 6de9423445 [dev.regabi] cmd/compile: cleanup OAS2FUNC ordering + 2021-01-16 a956a0e909 [dev.regabi] cmd/compile, runtime: fix up comments/error messages from recent renames + 2021-01-16 ab3b67abfd [dev.regabi] cmd/compile: remove ONEWOBJ + 2021-01-16 c9b1445ac8 [dev.regabi] cmd/compile: remove TypeAssertExpr {Src,Dst}Type fields + 2021-01-15 682a1d2176 runtime: detect errors in DuplicateHandle + 2021-01-15 9f83418b83 cmd/link: remove GOROOT write in TestBuildForTvOS + 2021-01-15 ec9470162f cmd/compile: allow embed into any string or byte slice type + 2021-01-15 54198b04db cmd/compile: disallow embed of var inside func + 2021-01-15 b386c735e7 cmd/go: fix go generate docs + 2021-01-15 bb5075a525 syscall: remove RtlGenRandom and move it into internal/syscall + 2021-01-15 1deae0b597 os: invoke processKiller synchronously in testKillProcess + 2021-01-15 03a875137f [dev.regabi] cmd/compile: unexport reflectdata.WriteType + 2021-01-15 14537e6e54 [dev.regabi] cmd/compile: move stkobj symbol generation to SSA + 2021-01-15 ab523fc510 [dev.regabi] cmd/compile: don't promote Byval CaptureVars if Addrtaken + 2021-01-15 ff196c3e84 crypto/x509: update iOS bundled roots to version 55188.40.9 + 2021-01-15 b7a698c73f [dev.regabi] test: disable test on windows because expected contains path separators. + 2021-01-15 4be7af23f9 [dev.regabi] cmd/compile: fix ICE during ir.Dump + 2021-01-14 e125ccd10e cmd/go: in 'go mod edit', validate versions given to -retract and -exclude + 2021-01-14 eb330020dc cmd/dist, cmd/go: pass -arch for C compilation on Darwin + 2021-01-14 84e8a06f62 cmd/cgo: remove unnecessary space in cgo export header + 2021-01-14 0c86b999c3 cmd/test2json: document passing -test.paniconexit0 + 2021-01-14 9135795891 cmd/go/internal/load: report positions for embed errors + 2021-01-14 35b9c66601 [dev.regabi] cmd/compile,cmd/link: additional code review suggestions for CL 270863 + 2021-01-14 d9b79e53bb cmd/compile: fix wrong complement for arm64 floating-point comparisons + 2021-01-14 c73232d08f cmd/go/internal/load: refactor setErrorPos to PackageError.setPos + 2021-01-14 6aa28d3e06 go/build: report positions for go:embed directives + 2021-01-14 9734fd482d [dev.regabi] cmd/compile: use node walked flag to prevent double walk for walkSwitch + 2021-01-14 f97983249a [dev.regabi] cmd/compile: move more PAUTOHEAP to SSA construction + 2021-01-14 4476300425 [dev.regabi] cmd/compile: use byte for CallExpr.Use + 2021-01-14 5a5ab24689 [dev.regabi] cmd/compile: do not rely on CallExpr.Rargs for detect already walked calls + 2021-01-14 983ac4b086 [dev.regabi] cmd/compile: fix ICE when initializing blank vars + 2021-01-13 7eb31d999c cmd/go: add hints to more missing sum error messages + 2021-01-13 d6d4673728 [dev.regabi] cmd/compile: fix GOEXPERIMENT=regabi builder + 2021-01-13 c41b999ad4 [dev.regabi] cmd/compile: refactor abiutils from "gc" into new "abi" + 2021-01-13 861707a8c8 [dev.regabi] cmd/compile: added limited //go:registerparams pragma for new ABI dev + 2021-01-13 c1370e918f [dev.regabi] cmd/compile: add code to support register ABI spills around morestack calls + 2021-01-13 2abd24f3b7 [dev.regabi] test: make run.go error messages slightly more informative + 2021-01-13 9a19481acb [dev.regabi] cmd/compile: make ordering for InvertFlags more stable + 2021-01-12 ba76567bc2 cmd/go/internal/modload: delete unused *mvsReqs.next method + 2021-01-12 665def2c11 encoding/asn1: document unmarshaling behavior for IMPLICIT string fields + 2021-01-11 81ea89adf3 cmd/go: fix non-script staleness checks interacting badly with GOFLAGS + 2021-01-11 759309029f doc: update editors.html for Go 1.16 + 2021-01-11 c3b4c7093a cmd/internal/objfile: don't require runtime.symtab symbol for XCOFF + 2021-01-08 59bfc18e34 cmd/go: add hint to read 'go help vcs' to GOVCS errors + 2021-01-08 cd6f3a54e4 cmd/go: revise 'go help' documentation for modules + 2021-01-08 6192b98751 cmd/go: make hints in error messages more consistent + 2021-01-08 25886cf4bd cmd/go: preserve sums for indirect deps fetched by 'go mod download' + 2021-01-08 6250833911 runtime/metrics: mark histogram metrics as cumulative + 2021-01-08 8f6a9acbb3 runtime/metrics: remove unused StopTheWorld Description field + 2021-01-08 6598c65646 cmd/compile: fix exponential-time init-cycle reporting + 2021-01-08 fefad1dc85 test: fix timeout code for invoking compiler + 2021-01-08 6728118e0a cmd/go: pass signals forward during "go tool" + 2021-01-08 e65c543f3c go/build/constraint: add parser for build tag constraint expressions + 2021-01-08 0c5afc4fb7 testing/fstest,os: clarify racy behavior of TestFS + 2021-01-08 32afcc9436 runtime/metrics: change unit on *-by-size metrics to match bucket unit + 2021-01-08 c6513bca5a io/fs: minor corrections to Glob doc + 2021-01-08 304f769ffc cmd/compile: don't short-circuit copies whose source is volatile + 2021-01-08 ae97717133 runtime,runtime/metrics: use explicit histogram boundaries + 2021-01-08 a9ccd2d795 go/build: skip string literal while findEmbed + 2021-01-08 d92f8add32 archive/tar: fix typo in comment + 2021-01-08 cab1202183 cmd/link: accept extra blocks in TestFallocate + 2021-01-08 ee4d32249b io/fs: minor corrections to Glob release date + 2021-01-08 54bd1ccce2 cmd: update to latest golang.org/x/tools + 2021-01-07 9ec21a8f34 Revert "reflect: support multiple keys in struct tags" + 2021-01-07 091414b5b7 io/fs: correct WalkDirFunc documentation + 2021-01-07 9b55088d6b doc/go1.16: add release note for disallowing non-ASCII import paths + 2021-01-07 fa90aaca7d cmd/compile: fix late expand_calls leaf type for OpStructSelect/OpArraySelect + 2021-01-07 7cee66d4cb cmd/go: add documentation for Embed fields in go list output + 2021-01-07 e60cffa4ca html/template: attach functions to namespace + 2021-01-07 6da2d3b7d7 cmd/link: fix typo in asm.go + 2021-01-07 df81a15819 runtime: check mips64 VDSO clock_gettime return code + 2021-01-06 4787e906cf crypto/x509: rollback new CertificateRequest fields + 2021-01-06 c9658bee93 cmd/go: make module suggestion more friendly + 2021-01-06 4c668b25c6 runtime/metrics: fix panic message for Float64Histogram + 2021-01-06 d2131704a6 net/http/httputil: fix deadlock in DumpRequestOut + 2021-01-05 3e1e13ce6d cmd/go: set cfg.BuildMod to "readonly" by default with no module root + 2021-01-05 0b0d004983 cmd/go: pass embedcfg to gccgo if supported + 2021-01-05 1b85e7c057 cmd/go: don't scan gccgo standard library packages for imports + 2021-01-05 6b37b15d95 runtime: don't take allglock in tracebackothers + 2021-01-04 9eef49cfa6 math/rand: fix typo in comment + 2021-01-04 b01fb2af9e testing/fstest: fix typo in error message + 2021-01-01 3dd5867605 doc: 2021 is the Year of the Gopher + 2020-12-31 95ce805d14 io/fs: remove darwin/arm64 special condition + 2020-12-30 20d0991b86 lib/time, time/tzdata: update tzdata to 2020f + 2020-12-30 ed301733bb misc/cgo/testcarchive: remove special flags for Darwin/ARM + 2020-12-30 0ae2e032f2 misc/cgo/test: enable TestCrossPackageTests on darwin/arm64 + 2020-12-29 780b4de16b misc/ios: fix wording for command line instructions + 2020-12-29 b4a71c95d2 doc/go1.16: reference misc/ios/README for how to build iOS programs + 2020-12-29 f83e0f6616 misc/ios: add to README how to build ios executables + 2020-12-28 4fd9455882 io/fs: fix typo in comment Change-Id: If24bb93f1e1e7deb1d92ba223c85940ab93b2732
2021-01-16[dev.regabi] cmd/compile, runtime: fix up comments/error messages from ↵Dan Scales
recent renames Went in a semi-automated way through the clearest renames of functions, and updated comments and error messages where it made sense. Change-Id: Ied8e152b562b705da7f52f715991a77dab60da35 Reviewed-on: https://go-review.googlesource.com/c/go/+/284216 Trust: Dan Scales <danscales@google.com> Run-TryBot: Dan Scales <danscales@google.com> TryBot-Result: Go Bot <gobot@golang.org> Reviewed-by: Matthew Dempsky <mdempsky@google.com>
2021-01-13[dev.regabi] cmd/compile: refactor abiutils from "gc" into new "abi"David Chase
Needs to be visible to ssagen, and might as well start clean to avoid creating a lot of accidental dependencies. Added some methods for export. Decided to use a pointer instead of value for ABIConfig uses. Tests ended up separate from abiutil itself; otherwise there are import cycles. Change-Id: I5570e1e6a463e303c5e2dc84e8dd4125e7c1adcc Reviewed-on: https://go-review.googlesource.com/c/go/+/282614 Trust: David Chase <drchase@google.com> Run-TryBot: David Chase <drchase@google.com> TryBot-Result: Go Bot <gobot@golang.org> Reviewed-by: Than McIntosh <thanm@google.com> Reviewed-by: Jeremy Faller <jeremy@golang.org>
2020-12-23[dev.typeparams] all: merge dev.regabi (37f138d) into dev.typeparamsRuss Cox
Conflicts: * src/cmd/compile/fmtmap_test.go * src/cmd/compile/internal/gc/go.go * src/cmd/compile/internal/gc/main.go * src/cmd/compile/internal/noder/noder.go Merge List: * 2020-12-23 37f138df6b [dev.regabi] cmd/compile: split out package test [generated] * 2020-12-23 3d8a3cb06b [dev.regabi] cmd/compile: split out package pkginit [generated] * 2020-12-23 3f04d964ab [dev.regabi] cmd/compile: split up walkexpr1, walkstmt [generated] * 2020-12-23 e4895ab4c0 [dev.regabi] cmd/compile: split out package walk [generated] * 2020-12-23 01fd2d05c8 [dev.regabi] cmd/compile: split out package dwarfgen [generated] * 2020-12-23 6c34d2f420 [dev.regabi] cmd/compile: split out package ssagen [generated] * 2020-12-23 de65151e50 [dev.regabi] cmd/compile: split out package reflectdata [generated] * 2020-12-23 4dfb5d91a8 [dev.regabi] cmd/compile: split out package staticdata [generated] * 2020-12-23 fbc82f03b1 [dev.regabi] cmd/compile: split out package noder [generated] * 2020-12-23 de454eef5f [dev.regabi] cmd/compile: split out package escape [generated] * 2020-12-23 071ab0a14c [dev.regabi] cmd/compile: split out package liveness [generated] * 2020-12-23 0ced54062e [dev.regabi] cmd/compile: split out package objw [generated] * 2020-12-23 575fd6ff0a [dev.regabi] cmd/compile: split out package inline [generated] * 2020-12-23 0256ba99a8 [dev.regabi] cmd/compile: split up typecheck1 [generated] * 2020-12-23 b9693d7627 [dev.regabi] cmd/compile: split out package typecheck [generated] * 2020-12-23 dac0de3748 [dev.regabi] cmd/compile: move type size calculations into package types [generated] * 2020-12-23 527a1895d6 [dev.regabi] cmd/compile: move helpers into package ir [generated] * 2020-12-23 65c4c6dfb2 [dev.regabi] cmd/compile: group known symbols, packages, names [generated] * 2020-12-23 9ee309255a [dev.regabi] cmd/compile: move helpers into package types [generated] * 2020-12-23 ead4957892 [dev.regabi] cmd/compile: move helpers into package base [generated] * 2020-12-23 440308ffd7 [dev.regabi] cmd/compile: simplify Nodes usage [generated] * 2020-12-23 f9d373720e [dev.regabi] cmd/compile: remove Left, Right etc methods [generated] * 2020-12-23 14d667341f [dev.regabi] cmd/compile: remove Node.Left etc [generated] * 2020-12-23 6f27d29be0 [dev.regabi] cmd/compile: remove ir.Nod [generated] * 2020-12-23 69cf39089f [dev.regabi] cmd/compile: do not die in early base.FlushErrors Change-Id: Ic4686e77c6ee38b3cd7d37fc7f3e93aaa9017b7a
2020-12-23[dev.regabi] cmd/compile: split out package test [generated]Russ Cox
[git-generate] cd src/cmd/compile/internal/gc rf ' mv bench_test.go constFold_test.go dep_test.go \ fixedbugs_test.go iface_test.go float_test.go global_test.go \ inl_test.go lang_test.go logic_test.go \ reproduciblebuilds_test.go shift_test.go ssa_test.go \ truncconst_test.go zerorange_test.go \ cmd/compile/internal/test ' mv testdata ../test Change-Id: I041971b7e9766673f7a331679bfe1c8110dcda66 Reviewed-on: https://go-review.googlesource.com/c/go/+/279480 Trust: Russ Cox <rsc@golang.org> Run-TryBot: Russ Cox <rsc@golang.org> Reviewed-by: Matthew Dempsky <mdempsky@google.com>
2020-10-29cmd/compile: use magic multiply for unsigned values less than 1<<16 on ↵Rémy Oudompheng
32-bit architectures This is done by decomposing the number to be divided in 32-bit components and using the 32-bit magic multiply. For the lowering to be effective the constant must fit in 16 bits. On ARM the expression n / 5 compiles to 25 instructions. Benchmark for GOARCH=arm (Cortex-A53) name old time/op new time/op delta DivconstU64/3-6 1.19µs ± 0% 0.03µs ± 1% -97.40% (p=0.000 n=9+9) DivconstU64/5-6 1.18µs ± 1% 0.03µs ± 1% -97.38% (p=0.000 n=10+8) DivconstU64/37-6 1.13µs ± 1% 0.04µs ± 1% -96.51% (p=0.000 n=10+8) DivconstU64/1234567-6 852ns ± 0% 901ns ± 1% +5.73% (p=0.000 n=8+9) Benchmark for GOARCH=386 (Haswell) name old time/op new time/op delta DivconstU64/3-4 18.0ns ± 2% 5.6ns ± 1% -69.06% (p=0.000 n=10+10) DivconstU64/5-4 17.8ns ± 1% 5.5ns ± 1% -68.87% (p=0.000 n=9+10) DivconstU64/37-4 17.8ns ± 1% 7.3ns ± 0% -58.90% (p=0.000 n=10+10) DivconstU64/1234567-4 17.5ns ± 1% 16.0ns ± 0% -8.55% (p=0.000 n=10+9) Change-Id: I38a19b4d59093ec021ef2e5241364a3dad4eae73 Reviewed-on: https://go-review.googlesource.com/c/go/+/264683 Run-TryBot: Emmanuel Odeke <emmanuel@orijtech.com> TryBot-Result: Go Bot <gobot@golang.org> Reviewed-by: Keith Randall <khr@golang.org> Trust: Emmanuel Odeke <emmanuel@orijtech.com>
2020-08-18cmd/compile: clean up and optimize s390x multiplication rulesMichael Munday
Some of the existing optimizations aren't triggered because they are handled by the generic rules so this CL removes them. Also some constraints were copied without much thought from the amd64 rules and they don't make sense on s390x, so we remove those constraints. Finally, add a 'multiply by the sum of two powers of two' optimization. This makes sense on s390x as shifts are low latency and can also sometimes be optimized further (especially if we add support for RISBG instructions). name old time/op new time/op delta IntMulByConst/3-8 1.70ns ±11% 1.10ns ± 5% -35.26% (p=0.000 n=10+10) IntMulByConst/5-8 1.64ns ± 7% 1.10ns ± 4% -32.94% (p=0.000 n=10+9) IntMulByConst/12-8 1.65ns ± 6% 1.20ns ± 4% -27.16% (p=0.000 n=10+9) IntMulByConst/120-8 1.66ns ± 4% 1.22ns ±13% -26.43% (p=0.000 n=10+10) IntMulByConst/-120-8 1.65ns ± 7% 1.19ns ± 4% -28.06% (p=0.000 n=9+10) IntMulByConst/65537-8 0.86ns ± 9% 1.12ns ±12% +30.41% (p=0.000 n=10+10) IntMulByConst/65538-8 1.65ns ± 5% 1.23ns ± 5% -25.11% (p=0.000 n=10+10) Change-Id: Ib196e6bff1e97febfd266134d0a2b2a62897989f Reviewed-on: https://go-review.googlesource.com/c/go/+/248937 Run-TryBot: Michael Munday <mike.munday@ibm.com> TryBot-Result: Gobot Gobot <gobot@golang.org> Reviewed-by: Keith Randall <khr@golang.org>
2019-04-27cmd/compile: add unsigned divisibility rulesBrian Kessler
"Division by invariant integers using multiplication" paper by Granlund and Montgomery contains a method for directly computing divisibility (x%c == 0 for c constant) by means of the modular inverse. The method is further elaborated in "Hacker's Delight" by Warren Section 10-17 This general rule can compute divisibilty by one multiplication and a compare for odd divisors and an additional rotate for even divisors. To apply the divisibility rule, we must take into account the rules to rewrite x%c = x-((x/c)*c) and (x/c) for c constant on the first optimization pass "opt". This complicates the matching as we want to match only in the cases where the result of (x/c) is not also available. So, we must match on the expanded form of (x/c) in the expression x == c*(x/c) in the "late opt" pass after common subexpresion elimination. Note, that if there is an intermediate opt pass introduced in the future we could simplify these rules by delaying the magic division rewrite to "late opt" and matching directly on (x/c) in the intermediate opt pass. Additional rules to lower the generic RotateLeft* ops were also applied. On amd64, the divisibility check is 25-50% faster. name old time/op new time/op delta DivconstI64-4 2.08ns ± 0% 2.08ns ± 1% ~ (p=0.881 n=5+5) DivisibleconstI64-4 2.67ns ± 0% 2.67ns ± 1% ~ (p=1.000 n=5+5) DivisibleWDivconstI64-4 2.67ns ± 0% 2.67ns ± 0% ~ (p=0.683 n=5+5) DivconstU64-4 2.08ns ± 1% 2.08ns ± 1% ~ (p=1.000 n=5+5) DivisibleconstU64-4 2.77ns ± 1% 1.55ns ± 2% -43.90% (p=0.008 n=5+5) DivisibleWDivconstU64-4 2.99ns ± 1% 2.99ns ± 1% ~ (p=1.000 n=5+5) DivconstI32-4 1.53ns ± 2% 1.53ns ± 0% ~ (p=1.000 n=5+5) DivisibleconstI32-4 2.23ns ± 0% 2.25ns ± 3% ~ (p=0.167 n=5+5) DivisibleWDivconstI32-4 2.27ns ± 1% 2.27ns ± 1% ~ (p=0.429 n=5+5) DivconstU32-4 1.78ns ± 0% 1.78ns ± 1% ~ (p=1.000 n=4+5) DivisibleconstU32-4 2.52ns ± 2% 1.26ns ± 0% -49.96% (p=0.000 n=5+4) DivisibleWDivconstU32-4 2.63ns ± 0% 2.85ns ±10% +8.29% (p=0.016 n=4+5) DivconstI16-4 1.54ns ± 0% 1.54ns ± 0% ~ (p=0.333 n=4+5) DivisibleconstI16-4 2.10ns ± 0% 2.10ns ± 1% ~ (p=0.571 n=4+5) DivisibleWDivconstI16-4 2.22ns ± 0% 2.23ns ± 1% ~ (p=0.556 n=4+5) DivconstU16-4 1.09ns ± 0% 1.01ns ± 1% -7.74% (p=0.000 n=4+5) DivisibleconstU16-4 1.83ns ± 0% 1.26ns ± 0% -31.52% (p=0.008 n=5+5) DivisibleWDivconstU16-4 1.88ns ± 0% 1.89ns ± 1% ~ (p=0.365 n=5+5) DivconstI8-4 1.54ns ± 1% 1.54ns ± 1% ~ (p=1.000 n=5+5) DivisibleconstI8-4 2.10ns ± 0% 2.11ns ± 0% ~ (p=0.238 n=5+4) DivisibleWDivconstI8-4 2.22ns ± 0% 2.23ns ± 2% ~ (p=0.762 n=5+5) DivconstU8-4 0.92ns ± 1% 0.94ns ± 1% +2.65% (p=0.008 n=5+5) DivisibleconstU8-4 1.66ns ± 0% 1.26ns ± 1% -24.28% (p=0.008 n=5+5) DivisibleWDivconstU8-4 1.79ns ± 0% 1.80ns ± 1% ~ (p=0.079 n=4+5) A follow-up change will address the signed division case. Updates #30282 Change-Id: I7e995f167179aa5c76bb10fbcbeb49c520943403 Reviewed-on: https://go-review.googlesource.com/c/go/+/168037 Run-TryBot: Brian Kessler <brian.m.kessler@gmail.com> TryBot-Result: Gobot Gobot <gobot@golang.org> Reviewed-by: Keith Randall <khr@golang.org>
2019-04-25cmd/compile: add signed divisibility by power of 2 rulesBrian Kessler
For powers of two (c=1<<k), the divisibility check x%c == 0 can be made just by checking the trailing zeroes via a mask x&(c-1) == 0 even for signed integers. This avoids division fix-ups when just divisibility check is needed. To apply this rule, we match on the fixed-up version of the division. This is neccessary because the mod and division rewrite rules are already applied during the initial opt pass. The speed up on amd64 due to elimination of unneccessary fix-up code is ~55%: name old time/op new time/op delta DivconstI64-4 2.08ns ± 0% 2.09ns ± 1% ~ (p=0.730 n=5+5) DivisiblePow2constI64-4 1.78ns ± 1% 0.81ns ± 1% -54.66% (p=0.008 n=5+5) DivconstU64-4 2.08ns ± 0% 2.08ns ± 0% ~ (p=0.683 n=5+5) DivconstI32-4 1.53ns ± 0% 1.53ns ± 1% ~ (p=0.968 n=4+5) DivisiblePow2constI32-4 1.79ns ± 1% 0.81ns ± 1% -54.97% (p=0.008 n=5+5) DivconstU32-4 1.78ns ± 1% 1.80ns ± 2% ~ (p=0.206 n=5+5) DivconstI16-4 1.54ns ± 2% 1.54ns ± 0% ~ (p=0.238 n=5+4) DivisiblePow2constI16-4 1.78ns ± 0% 0.81ns ± 1% -54.72% (p=0.000 n=4+5) DivconstU16-4 1.00ns ± 5% 1.01ns ± 1% ~ (p=0.119 n=5+5) DivconstI8-4 1.54ns ± 0% 1.54ns ± 2% ~ (p=0.571 n=4+5) DivisiblePow2constI8-4 1.78ns ± 0% 0.82ns ± 8% -53.71% (p=0.008 n=5+5) DivconstU8-4 0.93ns ± 1% 0.93ns ± 1% ~ (p=0.643 n=5+5) A follow-up CL will address the general case of x%c == 0 for signed integers. Updates #15806 Change-Id: Iabadbbe369b6e0998c8ce85d038ebc236142e42a Reviewed-on: https://go-review.googlesource.com/c/go/+/173557 Run-TryBot: Brian Kessler <brian.m.kessler@gmail.com> TryBot-Result: Gobot Gobot <gobot@golang.org> Reviewed-by: Keith Randall <khr@golang.org>
2019-04-23Revert "cmd/compile: add signed divisibility by power of 2 rules"Keith Randall
This reverts CL 168038 (git 68819fb6d2bab59e4eadcdf62aa4a2a54417d640) Reason for revert: Doesn't work on 32 bit archs. Change-Id: Idec9098060dc65bc2f774c5383f0477f8eb63a3d Reviewed-on: https://go-review.googlesource.com/c/go/+/173442 Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
2019-04-23cmd/compile: add signed divisibility by power of 2 rulesBrian Kessler
For powers of two (c=1<<k), the divisibility check x%c == 0 can be made just by checking the trailing zeroes via a mask x&(c-1)==0 even for signed integers. This avoids division fixups when just divisibility check is needed. To apply this rule the generic divisibility rule for A%B = A-(A/B*B) is disabled on the "opt" pass, but this does not affect generated code as this rule is applied later. The speed up on amd64 due to elimination of unneccessary fixup code is ~55%: name old time/op new time/op delta DivconstI64-4 2.08ns ± 0% 2.07ns ± 0% ~ (p=0.079 n=5+5) DivisiblePow2constI64-4 1.78ns ± 1% 0.81ns ± 1% -54.55% (p=0.008 n=5+5) DivconstU64-4 2.08ns ± 0% 2.08ns ± 0% ~ (p=1.000 n=5+5) DivconstI32-4 1.53ns ± 0% 1.53ns ± 0% ~ (all equal) DivisiblePow2constI32-4 1.79ns ± 1% 0.81ns ± 4% -54.75% (p=0.008 n=5+5) DivconstU32-4 1.78ns ± 1% 1.78ns ± 1% ~ (p=1.000 n=5+5) DivconstI16-4 1.54ns ± 2% 1.53ns ± 0% ~ (p=0.333 n=5+4) DivisiblePow2constI16-4 1.78ns ± 0% 0.79ns ± 1% -55.39% (p=0.000 n=4+5) DivconstU16-4 1.00ns ± 5% 0.99ns ± 1% ~ (p=0.730 n=5+5) DivconstI8-4 1.54ns ± 0% 1.53ns ± 0% ~ (p=0.714 n=4+5) DivisiblePow2constI8-4 1.78ns ± 0% 0.80ns ± 0% -55.06% (p=0.000 n=5+4) DivconstU8-4 0.93ns ± 1% 0.95ns ± 1% +1.72% (p=0.024 n=5+5) A follow-up CL will address the general case of x%c == 0 for signed integers. Updates #15806 Change-Id: I0d284863774b1bc8c4ce87443bbaec6103e14ef4 Reviewed-on: https://go-review.googlesource.com/c/go/+/168038 Reviewed-by: Keith Randall <khr@golang.org>
2016-04-29cmd/compile: Move divconst_test out of test/bench/go1David Chase
This is necessary to avoid disrupting the go1 suite and gives us a place to put other tests of basic compiler function and correctness. Change-Id: I36933819ff2bfe6a2121fff2be9a98efd2123d9a Reviewed-on: https://go-review.googlesource.com/22597 Run-TryBot: David Chase <drchase@google.com> TryBot-Result: Gobot Gobot <gobot@golang.org> Reviewed-by: Keith Randall <khr@golang.org>