aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJosh Bleecher Snyder <josharian@gmail.com>2015-06-23 16:44:06 -0700
committerJosh Bleecher Snyder <josharian@gmail.com>2015-06-24 20:44:57 +0000
commitd779b20cd2f435709cfbbbfa8af88f5e556866d8 (patch)
tree429b6d3be1ec118b55e3a60f05c7cbc4dedf710a
parent44be0e9c601cbb40a2ac8cf74cb0c57b1292825d (diff)
downloadgo-d779b20cd2f435709cfbbbfa8af88f5e556866d8.tar.xz
[dev.ssa] cmd/compile/ssa: improve comments, logging, and debug output
Change-Id: Id949db82ddaf802c1aa245a337081d4d46fd914f Reviewed-on: https://go-review.googlesource.com/11380 Reviewed-by: Alan Donovan <adonovan@google.com>
-rw-r--r--src/cmd/compile/internal/ssa/cse.go3
-rw-r--r--src/cmd/compile/internal/ssa/value.go6
2 files changed, 7 insertions, 2 deletions
diff --git a/src/cmd/compile/internal/ssa/cse.go b/src/cmd/compile/internal/ssa/cse.go
index 403c845152..7a1cf53ccb 100644
--- a/src/cmd/compile/internal/ssa/cse.go
+++ b/src/cmd/compile/internal/ssa/cse.go
@@ -15,6 +15,7 @@ func cse(f *Func) {
// v.op == w.op
// v.type == w.type
// v.aux == w.aux
+ // v.auxint == w.auxint
// len(v.args) == len(w.args)
// equivalent(v.args[i], w.args[i]) for i in 0..len(v.args)-1
@@ -23,7 +24,7 @@ func cse(f *Func) {
// It starts with a coarse partition and iteratively refines it
// until it reaches a fixed point.
- // Make initial partition based on opcode/type/aux/nargs
+ // Make initial partition based on opcode/type/aux/auxint/nargs
// TODO(khr): types are not canonical, so we split unnecessarily.
// For example, all pointer types are distinct. Fix this.
// As a data point, using v.Type.String() instead of
diff --git a/src/cmd/compile/internal/ssa/value.go b/src/cmd/compile/internal/ssa/value.go
index bfba8dc369..ef10fb20cd 100644
--- a/src/cmd/compile/internal/ssa/value.go
+++ b/src/cmd/compile/internal/ssa/value.go
@@ -59,7 +59,11 @@ func (v *Value) LongString() string {
s += fmt.Sprintf(" [%d]", v.AuxInt)
}
if v.Aux != nil {
- s += fmt.Sprintf(" {%v}", v.Aux)
+ if _, ok := v.Aux.(string); ok {
+ s += fmt.Sprintf(" {%q}", v.Aux)
+ } else {
+ s += fmt.Sprintf(" {%v}", v.Aux)
+ }
}
for _, a := range v.Args {
s += fmt.Sprintf(" %v", a)