cmd/compile: simple generics are not inlined #54497
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
Even the simplest one-line generic helpers are not inlined, which essentially kills the generic-based modularization approach. The compiler fails to inline and then strength-reduce the resulting code and generates the most generic variant instead. Not only will it severely impact performance, if the helper is called from the inner loop, but can blossom with all sorts of myths regarding Go generics, preventing their further adoption. The latter suggests the issue is more critical than it might initially appear.
What did you do?
Compile with:
go tool compile -S t1.go
What did you expect to see?
TEST $3f, AX
What did you see instead?
caller:
callee:
The text was updated successfully, but these errors were encountered: