diff options
author | Josh Bleecher Snyder <josharian@gmail.com> | 2015-09-11 10:28:33 -0700 |
---|---|---|
committer | Josh Bleecher Snyder <josharian@gmail.com> | 2015-09-11 20:49:18 +0000 |
commit | 9552295833ddec28f1e4dffc8f3e80b6448e6f83 (patch) | |
tree | 1af71623e4c5840bcc4ade3c18d6bccd66517b00 /src/cmd/compile/internal/ssa/cse.go | |
parent | cea441427e7a007ea5e35a4baa9cc2cb5d000f64 (diff) | |
download | go-9552295833ddec28f1e4dffc8f3e80b6448e6f83.tar.gz go-9552295833ddec28f1e4dffc8f3e80b6448e6f83.zip |
[dev.ssa] cmd/compile: minor CSE cleanup
Remove unnecessary local var split.
Change-Id: I907ef682b5fd9b3a67771edd1fe90c558f8937ea
Reviewed-on: https://go-review.googlesource.com/14523
Run-TryBot: Josh Bleecher Snyder <josharian@gmail.com>
Reviewed-by: Keith Randall <khr@golang.org>
Diffstat (limited to 'src/cmd/compile/internal/ssa/cse.go')
-rw-r--r-- | src/cmd/compile/internal/ssa/cse.go | 12 |
1 files changed, 5 insertions, 7 deletions
diff --git a/src/cmd/compile/internal/ssa/cse.go b/src/cmd/compile/internal/ssa/cse.go index 3b007c6192..25f424fbee 100644 --- a/src/cmd/compile/internal/ssa/cse.go +++ b/src/cmd/compile/internal/ssa/cse.go @@ -92,20 +92,18 @@ func cse(f *Func) { // all values in this equiv class that are not equivalent to v get moved // into another equiv class. // To avoid allocating while building that equivalence class, - // move the values equivalent to v to the beginning of e, - // other values to the end of e, and track where the split is. + // move the values equivalent to v to the beginning of e + // and other values to the end of e. allvals := e - split := len(e) eqloop: for j := 1; j < len(e); { w := e[j] for i := 0; i < len(v.Args); i++ { if valueEqClass[v.Args[i].ID] != valueEqClass[w.Args[i].ID] || !v.Type.Equal(w.Type) { // w is not equivalent to v. - // move it to the end, shrink e, and move the split. + // move it to the end and shrink e. e[j], e[len(e)-1] = e[len(e)-1], e[j] e = e[:len(e)-1] - split-- valueEqClass[w.ID] = len(partition) changed = true continue eqloop @@ -115,8 +113,8 @@ func cse(f *Func) { j++ } partition[i] = e - if split < len(allvals) { - partition = append(partition, allvals[split:]) + if len(e) < len(allvals) { + partition = append(partition, allvals[len(e):]) } } |