aboutsummaryrefslogtreecommitdiff
path: root/test/codegen
diff options
context:
space:
mode:
authorYoulin Feng <fengyoulin@live.com>2024-11-15 00:13:34 +0800
committerGopher Robot <gobot@golang.org>2024-11-22 00:12:03 +0000
commitc4e6ab9750e9d673a29203a9f41a517bcdc7a64c (patch)
treeff364da7a24bf8234c9900ab33c2cb076f6eabb7 /test/codegen
parent0edea47f264a4185d78e00e1e9e977d99f5c997b (diff)
downloadgo-c4e6ab9750e9d673a29203a9f41a517bcdc7a64c.tar.xz
cmd/compile: modify CSE to remove redundant OpLocalAddrs
Remove the OpLocalAddrs that are unnecessary in the CSE pass, so the following passes like DSE and memcombine can do its work better. Fixes #70300 Change-Id: I600025d49eeadb3ca4f092d614428399750f69bc Reviewed-on: https://go-review.googlesource.com/c/go/+/628075 Reviewed-by: Keith Randall <khr@google.com> Reviewed-by: David Chase <drchase@google.com> Auto-Submit: David Chase <drchase@google.com> LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com> Reviewed-by: Keith Randall <khr@golang.org>
Diffstat (limited to 'test/codegen')
-rw-r--r--test/codegen/memcombine.go26
1 files changed, 26 insertions, 0 deletions
diff --git a/test/codegen/memcombine.go b/test/codegen/memcombine.go
index ed319d17db..e1cae0e469 100644
--- a/test/codegen/memcombine.go
+++ b/test/codegen/memcombine.go
@@ -944,3 +944,29 @@ func issue66413(p *struct {
p.c = true
p.d = 12
}
+
+func issue70300(v uint64) (b [8]byte) {
+ // amd64:"MOVQ",-"MOVB"
+ b[0] = byte(v)
+ b[1] = byte(v >> 8)
+ b[2] = byte(v >> 16)
+ b[3] = byte(v >> 24)
+ b[4] = byte(v >> 32)
+ b[5] = byte(v >> 40)
+ b[6] = byte(v >> 48)
+ b[7] = byte(v >> 56)
+ return b
+}
+
+func issue70300Reverse(v uint64) (b [8]byte) {
+ // amd64:"MOVQ",-"MOVB"
+ b[7] = byte(v >> 56)
+ b[6] = byte(v >> 48)
+ b[5] = byte(v >> 40)
+ b[4] = byte(v >> 32)
+ b[3] = byte(v >> 24)
+ b[2] = byte(v >> 16)
+ b[1] = byte(v >> 8)
+ b[0] = byte(v)
+ return b
+}