Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

cmd/compile: suboptimal compilation of reflect.isZero #64222

Open
qiulaidongfeng opened this issue Nov 17, 2023 · 0 comments
Open

cmd/compile: suboptimal compilation of reflect.isZero #64222

qiulaidongfeng opened this issue Nov 17, 2023 · 0 comments
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

Comments

@qiulaidongfeng
Copy link
Contributor

What version of Go are you using (go version)?

$ go version
go version devel go1.22-b9a08f15 Thu Nov 16 22:15:45 2023 +0000 windows/amd64

Does this issue reproduce with the latest release?

yes.

What operating system and processor architecture are you using (go env)?

go env Output
$ go env
set GO111MODULE=auto
set GOARCH=amd64
set GOBIN=
set GOCACHE=D:\tmp\go-build
set GOENV=C:\Users\26454\AppData\Roaming\go\env
set GOEXE=.exe
set GOEXPERIMENT=
set GOFLAGS=
set GOHOSTARCH=amd64
set GOHOSTOS=windows
set GOINSECURE=
set GOMODCACHE=D:\file\gofile\pkg\mod
set GONOPROXY=
set GONOSUMDB=
set GOOS=windows
set GOPATH=D:\file\gofile
set GOPRIVATE=
set GOPROXY=https://goproxy.cn,direct
set GOROOT=D:\file\gofile\gogit\go1
set GOSUMDB=sum.golang.org
set GOTMPDIR=
set GOTOOLCHAIN=local
set GOTOOLDIR=D:\file\gofile\gogit\go1\pkg\tool\windows_amd64
set GOVCS=
set GOVERSION=devel go1.22-b9a08f15 Thu Nov 16 22:15:45 2023 +0000
set GCCGO=gccgo
set GOAMD64=v3
set AR=ar
set CC=gcc
set CXX=g++
set CGO_ENABLED=0
set GOMOD=D:\file\gofile\gogit\go1\src\go.mod
set GOWORK=
set CGO_CFLAGS=-O2 -g
set CGO_CPPFLAGS=
set CGO_CXXFLAGS=-O2 -g
set CGO_FFLAGS=-O2 -g
set CGO_LDFLAGS=-O2 -g
set PKG_CONFIG=pkg-config
set GOGCCFLAGS=-m64 -Wl,--no-gc-sections -fmessage-length=0 -ffile-prefix-map=C:\Users\26454\AppData\Local\Temp\go-build3613428875=/tmp/go-build -gno-record-gcc-switches

What did you do?

cd reflect
go test -c
go tool objdump reflect.test.exe

What did you expect to see?

I want reflect.isZero to use SIMD when GOAMD64 is greater than v1.
Avoid For all zeros, performance is not as good as return bytealg.Count(b, byte(0)) == len(b).

What did you see instead?

I see that reflect.isZero uses CMPQ when GOAMD64 is greater than v1.

@gopherbot gopherbot added the compiler/runtime Issues related to the Go compiler and/or runtime. label Nov 17, 2023
@randall77 randall77 added this to the Unplanned milestone Nov 17, 2023
@mknyszek mknyszek added the NeedsInvestigation Someone must examine and confirm this is a valid issue and not a duplicate of an existing one. label Nov 20, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
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
Projects
None yet
Development

No branches or pull requests

5 participants