cmd/compile: arithmeticize memory loads statically known to only touch the .rodata
section
#70956
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
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:
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.
The text was updated successfully, but these errors were encountered: