cmd/compile: multiple LittleEndian.Uint* calls on the same buffer block load merging #52708
Labels
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
)?What did you do?
What did you expect to see?
A single MOVL for LittleEndian.Uint32, and a single MOVQ for each LittleEndian.(Put)?Uint64, or something similar.
What did you see instead?
(*T).shiftBuf gets inlined. The Uint32 call then gets broken up into four byte loads. The first Uint64 becomes a MOVL to fetch the upper word, which is then combined with the Uint32 result. The final PutUint64 is broken up into two MOVLs. With gotip:
GOARCH=arm64 produces byte loads and shifts too.
The text was updated successfully, but these errors were encountered: