slices: better generated code of slices.Clone? #60499
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
Milestone
code of slices.Clone in master is:
test code:
slices.Clone will be inline.
generate asm in amd64:
generate asm in arm64:
if we change slices.Clone to:
generate code in amd64:
generate code in arm64:
I think
is better than
because, for example in amd64:
the difference is between XORL AX, AX and LEAQ 0x28(SP), AX.
I think XORL is better than LEAQ in here.
Do you agree with this?
If you agree with me, I will send a cl.
The text was updated successfully, but these errors were encountered: