]> Cypherpunks repositories - gostls13.git/commit
[dev.simd] cmd/compile: remove stores to unread parameters
authorCherry Mui <cherryyz@google.com>
Mon, 22 Sep 2025 14:57:29 +0000 (10:57 -0400)
committerCherry Mui <cherryyz@google.com>
Tue, 23 Sep 2025 15:05:41 +0000 (08:05 -0700)
commit2b50ffe172ee638a88e2750481eaeeac7d3bedfa
tree4f89092a95e012259057717868b9a45aca92178e
parent2d8cb80d7c4af3dbcb507783938ceb0e071f64e3
[dev.simd] cmd/compile: remove stores to unread parameters

Currently, we remove stores to local variables that are not read.
We don't do that for arguments. But arguments and locals are
essentially the same. Arguments are passed by value, and are not
expected to be read in the caller's frame. So we can remove the
writes to them as well. One exception is the cgo_unsafe_arg
directive, which makes all the arguments effectively address-taken.
cgo_unsafe_arg implies ABI0, so we just skip ABI0 functions'
arguments.

Change-Id: I8999fc50da6a87f22c1ec23e9a0c15483b6f7df8
Reviewed-on: https://go-review.googlesource.com/c/go/+/705815
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Reviewed-by: David Chase <drchase@google.com>
Reviewed-by: Junyang Shao <shaojunyang@google.com>
src/cmd/compile/internal/ssa/deadstore.go
src/runtime/testdata/testprog/badtraceback.go
test/codegen/stack.go