-
Notifications
You must be signed in to change notification settings - Fork 18.5k
Open
Labels
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
While doing https://go-review.googlesource.com/c/go/+/637936/3 I tested it on some code of mine and it failed to mark many of my functions pure because one callgraph leaf use a const string as a LUT.
This would also allow the compiler to reorder theses loads with stores which could help regalloc among other things.
For an example I made up this very simple function:
func hexDigit(x uint8) rune {
return rune("0123456789abcdef"[x & 0b1111])
}You can see that the Load op takes memory as an argument when this is not needed.

In this context we should model [] as an odd arithmetic operator by removing it's memory argument.
Chances I'll come back to this at some point.
Metadata
Metadata
Assignees
Labels
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