/ go Public
cmd/compile: Load optimization suboptimal #48222
Issues related to the Go compiler and/or runtime.
Someone must examine and confirm this is a valid issue and not a duplicate of an existing one.
What version of Go are you using (
Does this issue reproduce with the latest release?
Yes. And also previous versions.
What operating system and processor architecture are you using (
What did you do?
What did you expect to see?
MOVLinstruction used to load uint32.
What did you see instead?
The compiler tries to put the value together with the previous load, 2 other loads, 2 shifts and 2 or operations.
It it safe to rely on the value being in L1 when it has just been loaded. Some modern archs even do memory -> virtual register aliasing. I don't see any cases where this "optimization" is a benefit compared to straight up reloading the value.
The text was updated successfully, but these errors were encountered: