-
Notifications
You must be signed in to change notification settings - Fork 18.8k
Open
Labels
ImplementationIssues describing a semantics-preserving change to the Go implementation.Issues describing a semantics-preserving change to the Go implementation.NeedsInvestigationSomeone must examine and confirm this is a valid issue and not a duplicate of an existing one.Someone must examine and confirm this is a valid issue and not a duplicate of an existing one.Performancecompiler/runtimeIssues related to the Go compiler and/or runtime.Issues related to the Go compiler and/or runtime.
Milestone
Description
go version go1.26-devel_e7c0b74a97 Tue Jan 6 20:29:01 2026 +0100 linux/amd64
We do loop rotation extremely late.
Consider this loop:
for range c {
a()
}We will compile to this (pseudo-code):
i := c
goto check
loop:
a()
i--
check:
if i != 0 { goto loop }The "classical" form would be*:
if c == 0 { goto skip }
i := c
loop:
a()
i--
if i != 0 { goto loop }
skip:*reversing iteration order of loops isn't classic, but it's not what I want to point out.
Metadata
Metadata
Assignees
Labels
ImplementationIssues describing a semantics-preserving change to the Go implementation.Issues describing a semantics-preserving change to the Go implementation.NeedsInvestigationSomeone must examine and confirm this is a valid issue and not a duplicate of an existing one.Someone must examine and confirm this is a valid issue and not a duplicate of an existing one.Performancecompiler/runtimeIssues related to the Go compiler and/or runtime.Issues related to the Go compiler and/or runtime.
Type
Projects
Status
Todo