-
Notifications
You must be signed in to change notification settings - Fork 17.7k
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: fold constants found by prove #52669
Conversation
This PR (HEAD: 2930f74) has been imported to Gerrit for code review. Please visit https://go-review.googlesource.com/c/go/+/403735 to see it. Tip: You can toggle comments from me using the |
This PR (HEAD: ed1157d) has been imported to Gerrit for code review. Please visit https://go-review.googlesource.com/c/go/+/403735 to see it. Tip: You can toggle comments from me using the |
This PR (HEAD: 5538cdf) has been imported to Gerrit for code review. Please visit https://go-review.googlesource.com/c/go/+/403735 to see it. Tip: You can toggle comments from me using the |
Message from Keith Randall: Patch Set 4: Run-TryBot+1 Code-Review+2 (2 comments) Please don’t reply on this GitHub thread. Visit golang.org/cl/403735. |
Message from Gopher Robot: Patch Set 4: (1 comment) Please don’t reply on this GitHub thread. Visit golang.org/cl/403735. |
Message from Gopher Robot: Patch Set 4: (1 comment) Please don’t reply on this GitHub thread. Visit golang.org/cl/403735. |
Message from Gopher Robot: Patch Set 4: TryBot-Result-1 (1 comment) Please don’t reply on this GitHub thread. Visit golang.org/cl/403735. |
Message from Jorropo: Patch Set 4: (2 comments) Please don’t reply on this GitHub thread. Visit golang.org/cl/403735. |
Message from Keith Randall: Patch Set 4: (1 comment) Please don’t reply on this GitHub thread. Visit golang.org/cl/403735. |
Message from Jorropo: Patch Set 4: (1 comment) Please don’t reply on this GitHub thread. Visit golang.org/cl/403735. |
Message from Keith Randall: Patch Set 4: (1 comment) Please don’t reply on this GitHub thread. Visit golang.org/cl/403735. |
Message from Jorropo: Patch Set 4: (1 comment) Please don’t reply on this GitHub thread. Visit golang.org/cl/403735. |
Message from Keith Randall: Patch Set 4: (1 comment) Please don’t reply on this GitHub thread. Visit golang.org/cl/403735. |
Message from Jorropo: Patch Set 4: (1 comment) Please don’t reply on this GitHub thread. Visit golang.org/cl/403735. |
This PR (HEAD: 3e0176e) has been imported to Gerrit for code review. Please visit https://go-review.googlesource.com/c/go/+/403735 to see it. Tip: You can toggle comments from me using the |
Message from Jorropo: Patch Set 4: (2 comments) Please don’t reply on this GitHub thread. Visit golang.org/cl/403735. |
This PR (HEAD: ca2eafd) has been imported to Gerrit for code review. Please visit https://go-review.googlesource.com/c/go/+/403735 to see it. Tip: You can toggle comments from me using the |
Message from Keith Randall: Patch Set 6: Run-TryBot+1 Auto-Submit+1 Code-Review+2 Please don’t reply on this GitHub thread. Visit golang.org/cl/403735. |
Message from Gopher Robot: Patch Set 6: (1 comment) Please don’t reply on this GitHub thread. Visit golang.org/cl/403735. |
Message from Keith Randall: Patch Set 6: Code-Review+1 Please don’t reply on this GitHub thread. Visit golang.org/cl/403735. |
Message from Daniel Martí: Patch Set 6: (2 comments) Please don’t reply on this GitHub thread. Visit golang.org/cl/403735. |
It is hit ~70k times building go. This make the go binary, 0.04% smaller. For example, this enable rewriting things like: if x == 20 { return x + 30 + z } Into: if x == 20 { return 50 + z } It's not just fixing programer's code, the ssa generator generate code like this sometimes.
Message from Gopher Robot: Patch Set 6: TryBot-Result+1 (1 comment) Please don’t reply on this GitHub thread. Visit golang.org/cl/403735. |
Message from Jorropo: Patch Set 6: (3 comments) Please don’t reply on this GitHub thread. Visit golang.org/cl/403735. |
This PR (HEAD: 4c2f9b5) has been imported to Gerrit for code review. Please visit https://go-review.googlesource.com/c/go/+/403735 to see it. Tip: You can toggle comments from me using the |
Message from Jorropo: Patch Set 7: (1 comment) Please don’t reply on this GitHub thread. Visit golang.org/cl/403735. |
Message from Keith Randall: Patch Set 7: Run-TryBot+1 Code-Review+2 Please don’t reply on this GitHub thread. Visit golang.org/cl/403735. |
Message from Gopher Robot: Patch Set 7: (1 comment) Please don’t reply on this GitHub thread. Visit golang.org/cl/403735. |
Message from Gopher Robot: Patch Set 7: TryBot-Result+1 (1 comment) Please don’t reply on this GitHub thread. Visit golang.org/cl/403735. |
Message from David Chase: Patch Set 7: Code-Review+1 Please don’t reply on this GitHub thread. Visit golang.org/cl/403735. |
It is hit ~70k times building go. This make the go binary, 0.04% smaller. I didn't included benchmarks because this is just constant foldings and is hard to mesure objectively. For example, this enable rewriting things like: if x == 20 { return x + 30 + z } Into: if x == 20 { return 50 + z } It's not just fixing programer's code, the ssa generator generate code like this sometimes. Change-Id: I0861f342b27f7227b5f1c34d8267fa0057b1bbbc GitHub-Last-Rev: 4c2f9b5 GitHub-Pull-Request: #52669 Reviewed-on: https://go-review.googlesource.com/c/go/+/403735 Reviewed-by: Keith Randall <khr@google.com> TryBot-Result: Gopher Robot <gobot@golang.org> Run-TryBot: Keith Randall <khr@golang.org> Reviewed-by: Keith Randall <khr@golang.org> Reviewed-by: David Chase <drchase@google.com>
This PR is being closed because golang.org/cl/403735 has been merged. |
It is hit ~70k times building go.
This make the go binary, 0.04% smaller.
I didn't included benchmarks because this is just constant foldings
and is hard to mesure objectively.
For example, this enable rewriting things like:
if x == 20 {
return x + 30 + z
}
Into:
if x == 20 {
return 50 + z
}
It's not just fixing programer's code,
the ssa generator generate code like this sometimes.