cmd/compile: missed optimization: binary alignment is unnecessarily complex #54496
Labels
compiler/runtime
Issues related to the Go compiler and/or runtime.
FrozenDueToAge
NeedsFix
The path to resolution is known, but the work has not been done.
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
)?amd64/windows
If binary alignment like in the function below is encountered, the compiler correctly strength reduces the division/multiplication to shifts, but then fails to combine them into a single `and`. In general `(x >> N) << N` should be further folded to `x & -(1 << N)` for constant N during strength reduction
What did you do?
Compile:
go tool compile -S t1.go
Output:
What did you expect to see?
ANDQ $FFFFFFFFFFFFFFC0, AX
What did you see instead?
The text was updated successfully, but these errors were encountered: