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: optimize LEAQ address calculations #37736

Closed
rillig opened this issue Mar 7, 2020 · 1 comment
Closed

cmd/compile: optimize LEAQ address calculations #37736

rillig opened this issue Mar 7, 2020 · 1 comment

Comments

@rillig
Copy link
Contributor

@rillig rillig commented Mar 7, 2020

What version of Go are you using?

go version go1.13.1 windows/amd64

What did you do?

https://play.golang.org/p/Wvp_nntNomk

What did you expect to see?

line 12: LEAQ 0x2(CX)(CX*1), DX

What did you see instead?

line 12: LEAQ 0(CX)(CX*1), DX
line 12: LEAQ 0x2(DX), DX

I'm not sure whether merging these two instructions would make a large difference, I just expect the optimizer to know the instruction set well enough to make this optimization.

@randall77
Copy link
Contributor

@randall77 randall77 commented Mar 7, 2020

This is intentional. See #21735.

@randall77 randall77 closed this Mar 7, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
2 participants
You can’t perform that action at this time.