cmd/compile: maps doesn't recognize map-clearing range idiom after be inlined #53157
Labels
compiler/runtime
Issues related to the Go compiler and/or runtime.
FrozenDueToAge
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
)?linux & windows , amd64
What did you do?
https://go.dev/play/p/wi_i3Dx8Hpa
In go1.18, the compiler will inline clearMap by default, then generates:
and clearMap2 will call runtime.mapclear.
Is this expected behavior?
(go1.17 will not inline clearMap)
The text was updated successfully, but these errors were encountered: