Navigation Menu

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 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

This is intentional. See #21735.

@golang golang locked and limited conversation to collaborators Mar 7, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

3 participants