Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

cmd/compile: unnecessary copy in regalloc #44670

Open
josharian opened this issue Feb 27, 2021 · 0 comments
Open

cmd/compile: unnecessary copy in regalloc #44670

josharian opened this issue Feb 27, 2021 · 0 comments
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

Comments

@josharian
Copy link
Contributor

After CLs 297049 and 297050, generate code for shrVU_g in math/big.

The result includes these two instructions:

v121 00026 (+181) LEAQ 1(R10), R8
v107 00027 (181) MOVQ R8, CX

After this, R8 is dead. So this could have just been one instruction, LEAQ 1(R10), CX. Here's the relevant block after regalloc:

Screen Shot 2021-02-27 at 11 36 04 AM

This is the sort of thing a peephole pass could help with (#15300), but maybe now that Values have Uses counts there's a way to detect and improve this in regalloc directly.

cc @randall77 @cherrymui

@dmitshur dmitshur added the NeedsInvestigation Someone must examine and confirm this is a valid issue and not a duplicate of an existing one. label Mar 5, 2021
@dmitshur dmitshur added this to the Backlog milestone Mar 5, 2021
@gopherbot gopherbot added the compiler/runtime Issues related to the Go compiler and/or runtime. label Jul 13, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
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
Projects
Status: Triage Backlog
Development

No branches or pull requests

3 participants