aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorKeith Randall <khr@golang.org>2024-03-21 09:15:30 -0700
committerKeith Randall <khr@golang.org>2024-03-21 19:45:41 +0000
commit802473cfda17a116f705e4060d7b70828e763689 (patch)
tree0c1cdfce1195168c6543759001594c7e97382aa5 /src
parent5e1e3a002528714f7c5954dd13068a89f41f747a (diff)
downloadgo-802473cfda17a116f705e4060d7b70828e763689.tar.xz
cmd/compile: include constant bools in memcombine
Constant bools are like constant 1-byte values, they memcombine just fine. (There are still trickier cases that this pass doesn't catch yet, see TODO at memcombine.go:503.) Fixes #66413 Change-Id: Ia67cf72ed1c416e27ac22da443bd88a3f09a6cc8 Reviewed-on: https://go-review.googlesource.com/c/go/+/573416 LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com> Reviewed-by: David Chase <drchase@google.com> Reviewed-by: Joseph Tsai <joetsai@digital-static.net> Reviewed-by: Mauri de Souza Meneguzzo <mauri870@gmail.com> Reviewed-by: Keith Randall <khr@google.com>
Diffstat (limited to 'src')
-rw-r--r--src/cmd/compile/internal/ssa/memcombine.go2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/cmd/compile/internal/ssa/memcombine.go b/src/cmd/compile/internal/ssa/memcombine.go
index b1a47510be..a7e8ede5bc 100644
--- a/src/cmd/compile/internal/ssa/memcombine.go
+++ b/src/cmd/compile/internal/ssa/memcombine.go
@@ -534,7 +534,7 @@ func combineStores(root *Value, n int64) bool {
isConst := true
for i := int64(0); i < n; i++ {
switch a[i].store.Args[1].Op {
- case OpConst32, OpConst16, OpConst8:
+ case OpConst32, OpConst16, OpConst8, OpConstBool:
default:
isConst = false
break