mirror of
https://github.com/golang/go.git
synced 2025-05-05 07:33:00 +00:00
Look for possible paired load/store operations on arm64. I don't expect this would be a lot faster, but it will save binary space, and indirectly through the icache at least a bit of time. Change-Id: I4dd73b0e6329c4659b7453998f9b75320fcf380b Reviewed-on: https://go-review.googlesource.com/c/go/+/629256 LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com> Reviewed-by: David Chase <drchase@google.com> Auto-Submit: Keith Randall <khr@golang.org> Reviewed-by: Keith Randall <khr@google.com>
29 lines
550 B
Go
29 lines
550 B
Go
// errorcheck -0 -d=ssa/tighten/debug=1
|
|
|
|
//go:build arm64
|
|
|
|
// 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
|
|
|
|
var (
|
|
ga, gb, gc, gd int
|
|
)
|
|
|
|
func moveValuesWithMemoryArg(len int) {
|
|
for n := 0; n < len; n++ {
|
|
// Loads of b and d can be delayed until inside the outer "if".
|
|
a := ga
|
|
b := gb // ERROR "MOVDload is moved$"
|
|
c := gc
|
|
d := gd // ERROR "MOVDload is moved$"
|
|
if a == c {
|
|
if b == d {
|
|
return
|
|
}
|
|
}
|
|
}
|
|
}
|