Join GitHub today
GitHub is home to over 50 million developers working together to host and review code, manage projects, and build software together.Sign up
cmd/compile: reordering struct field accesses can alter performance #22479
What version of Go are you using (
Pasting code here:
The extra instruction doesn't really matter - it's the extra load that matters.
This is a tricky problem to solve in general, because it requires some alias analysis. Perhaps something could be done for this simpler situation (different constant offsets from the same pointer).