cmd/compile: optimize dead store #50325
Labels
compiler/runtime
Issues related to the Go compiler and/or runtime.
NeedsInvestigation
Someone must examine and confirm this is a valid issue and not a duplicate of an existing one.
Performance
Milestone
What version of Go are you using (
go version
)?Does this issue reproduce with the latest release?
Yes
What operating system and processor architecture are you using (
go env
)?go env
OutputWhat did you do?
go tool compile -S x.go
to see generated assembly code of function x.What did you expect to see?
The multiple times of assignment can be optimized to
MOVQ $12, AX
in regABI,with three reasons:
i
is located in local stack frame.i=0
(zeroing)/i=5
/i=67
are not read by any subsequent instruction.atomic.Store
operations can be optimzed here).What did you see instead?
The text was updated successfully, but these errors were encountered: