]> Cypherpunks repositories - gostls13.git/commit
[dev.ssa] cmd/compile/internal/ssa: distribute multiplication into addition
authorAlexandru Moșoi <mosoi@google.com>
Tue, 1 Mar 2016 12:39:47 +0000 (13:39 +0100)
committerAlexandru Moșoi <alexandru@mosoi.ro>
Tue, 1 Mar 2016 17:05:13 +0000 (17:05 +0000)
commit1f6e9e36b0aba3d2459c80b2c8e905d9cc57f7ce
tree2127472ddfa265d962071ef674205570bb6b631c
parente96b232993fa8edb478f32041e08e5cf5c74395d
[dev.ssa] cmd/compile/internal/ssa: distribute multiplication into addition

* This is a very basic form of straight line strength reduction.
* Removes one multiplication from a[b].c++; a[b+1].c++
* It increases pressure on the register allocator because
CSE creates more copies of the multiplication sizeof(a[0])*b.

Change-Id: I686a18e9c24cc6f8bdfa925713afed034f7d36d0
Reviewed-on: https://go-review.googlesource.com/20091
Run-TryBot: Alexandru Moșoi <alexandru@mosoi.ro>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Keith Randall <khr@golang.org>
src/cmd/compile/internal/ssa/gen/generic.rules
src/cmd/compile/internal/ssa/rewritegeneric.go