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: missed constant folding #14363

Closed
brtzsnr opened this issue Feb 17, 2016 · 2 comments
Closed

cmd/compile: missed constant folding #14363

brtzsnr opened this issue Feb 17, 2016 · 2 comments

Comments

@brtzsnr
Copy link
Contributor

brtzsnr commented Feb 17, 2016

dev.ssa branch.

The compiler doesn't detect that v24 is a copy of v23 in the following case.
v23 = Or64 v19 v22
v24 = Or64 v19 v23

The compiler doesn't detect that v24 is a copy of v22 in the following case.
v23 = Xor64 v12 v22
v24 = Xor64 v12 v23

Not sure if we care about them or if they can be done (in a more general case) using rewrite rules only.

@randall77
Copy link
Contributor

(or x (or x y)) -> (or x y) seems like a simple rewrite rule to capture this case.

In general, I'm not too worried about such cases. They tend not to happen much in user's code (except maybe generated code?) and the compiler doesn't introduce them as part of other phases.

@bradfitz bradfitz added this to the Go1.7 milestone Apr 10, 2016
@gopherbot
Copy link

CL https://golang.org/cl/22188 mentions this issue.

@golang golang locked and limited conversation to collaborators Apr 18, 2017
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

4 participants