Closed
Description
What version of Go are you using (go version
)?
$ go version
Does this issue reproduce with the latest release?
What operating system and processor architecture are you using (go env
)?
go env
Output
$ go env
What did you do?
Hi, I found that we have a potential local optimization for subtraction involving common integers, which is also implemented in other compilers. i.e. (t + x) - (t + y) ==> x - y
. The compiler itself matches such a pattern 303 times after a quick try, it seems that this could be a candidate for generic rules. I'd like to add it if you think it's worth doing. Thanks for your patience.