diff options
author | David Chase <drchase@google.com> | 2023-05-09 10:34:52 -0400 |
---|---|---|
committer | David Chase <drchase@google.com> | 2023-10-06 20:57:33 +0000 |
commit | b72bbaebf9035c59806fd8073f2582e2d07764d5 (patch) | |
tree | d63910018f9e5b22003da778f1f6361434d51f14 /test/abi | |
parent | 8b6e0e6e8eb3a86ef1454a52a11bf75a077c56c5 (diff) | |
download | go-b72bbaebf9035c59806fd8073f2582e2d07764d5.tar.gz go-b72bbaebf9035c59806fd8073f2582e2d07764d5.zip |
cmd/compile: expand calls cleanup
Convert expand calls into a smaller number of focused
recursive rewrites, and rely on an enhanced version of
"decompose" to clean up afterwards.
Debugging information seems to emerge intact.
Change-Id: Ic46da4207e3a4da5c8e2c47b637b0e35abbe56bb
Reviewed-on: https://go-review.googlesource.com/c/go/+/507295
Run-TryBot: David Chase <drchase@google.com>
Reviewed-by: Cherry Mui <cherryyz@google.com>
Reviewed-by: Keith Randall <khr@golang.org>
TryBot-Result: Gopher Robot <gobot@golang.org>
Diffstat (limited to 'test/abi')
-rw-r--r-- | test/abi/more_intstar_input.go | 8 | ||||
-rw-r--r-- | test/abi/reg_not_ssa.go | 40 |
2 files changed, 42 insertions, 6 deletions
diff --git a/test/abi/more_intstar_input.go b/test/abi/more_intstar_input.go index f0a48fbdc2..3eb0fbcc3d 100644 --- a/test/abi/more_intstar_input.go +++ b/test/abi/more_intstar_input.go @@ -12,10 +12,6 @@ package main -import ( - "fmt" -) - var sink int //go:registerparams @@ -33,12 +29,12 @@ func G(a, b, c, d, e, f, g, h, i, j, k, l, m *int) { var scratch [1000 * 100]int I := *c - *e - *l // zero. scratch[I] = *d - fmt.Println("Got this far!") + println("Got this far!") sink += scratch[0] } func main() { a, b, c, d, e, f, g, h, i, j, k, l, m := 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13 F(&a, &b, &c, &d, &e, &f, &g, &h, &i, &j, &k, &l, &m) - fmt.Printf("Sink = %d\n", sink-7) + println("Sink =", sink-7) } diff --git a/test/abi/reg_not_ssa.go b/test/abi/reg_not_ssa.go new file mode 100644 index 0000000000..5bd4b51a6b --- /dev/null +++ b/test/abi/reg_not_ssa.go @@ -0,0 +1,40 @@ +// run + +//go:build !wasm +// +build !wasm + +// Copyright 2023 The Go Authors. All rights reserved. +// Use of this source code is governed by a BSD-style +// license that can be found in the LICENSE file. + +package main + +// small enough for registers, too large for SSA +type T struct { + a, b, c, d, e int +} + +//go:noinline +func F() { + a, b := g(), g() + h(b, b) + h(a, g()) + if a.a == 1 { + a = g() + } + h(a, a) +} + +//go:noinline +func g() T { + return T{1, 2, 3, 4, 5} +} + +//go:noinline +func h(s, t T) { + if s != t { + println("NEQ") + } +} + +func main() { F() } |