aboutsummaryrefslogtreecommitdiff
path: root/src/cmd/compile/internal/ssa/decompose.go
diff options
context:
space:
mode:
authorKeith Randall <khr@golang.org>2015-10-22 14:22:38 -0700
committerKeith Randall <khr@golang.org>2015-10-28 17:00:31 +0000
commitc24681ae2e1c96bd67c149cffa8f5ed394e68453 (patch)
tree901661939332bae3a55be8102da790778f1161e8 /src/cmd/compile/internal/ssa/decompose.go
parentd43f2e37edf4115e31a0c9218d87182d0aa1c4f0 (diff)
downloadgo-c24681ae2e1c96bd67c149cffa8f5ed394e68453.tar.gz
go-c24681ae2e1c96bd67c149cffa8f5ed394e68453.zip
[dev.ssa] cmd/compile: remember names of values
For debugging, spill values to named variables instead of autotmp_ variables if possible. We do this by keeping a name -> value map for each function, keep it up-to-date during deadcode elim, and use it to override spill decisions in stackalloc. It might even make stack frames a bit smaller, as it makes it easy to identify a set of spills which are likely not to interfere. This just works for one-word variables for now. Strings/slices will be a separate CL. Change-Id: Ie89eba8cab16bcd41b311c479ec46dd7e64cdb67 Reviewed-on: https://go-review.googlesource.com/16336 Run-TryBot: Keith Randall <khr@golang.org> Reviewed-by: David Chase <drchase@google.com>
Diffstat (limited to 'src/cmd/compile/internal/ssa/decompose.go')
-rw-r--r--src/cmd/compile/internal/ssa/decompose.go4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/cmd/compile/internal/ssa/decompose.go b/src/cmd/compile/internal/ssa/decompose.go
index 3ef20ef34f..2057d8ea5c 100644
--- a/src/cmd/compile/internal/ssa/decompose.go
+++ b/src/cmd/compile/internal/ssa/decompose.go
@@ -36,7 +36,7 @@ func decompose(f *Func) {
func decomposeStringPhi(v *Value) {
fe := v.Block.Func.Config.fe
ptrType := fe.TypeBytePtr()
- lenType := fe.TypeUintptr()
+ lenType := fe.TypeInt()
ptr := v.Block.NewValue0(v.Line, OpPhi, ptrType)
len := v.Block.NewValue0(v.Line, OpPhi, lenType)
@@ -55,7 +55,7 @@ func decomposeStringPhi(v *Value) {
func decomposeSlicePhi(v *Value) {
fe := v.Block.Func.Config.fe
ptrType := fe.TypeBytePtr()
- lenType := fe.TypeUintptr()
+ lenType := fe.TypeInt()
ptr := v.Block.NewValue0(v.Line, OpPhi, ptrType)
len := v.Block.NewValue0(v.Line, OpPhi, lenType)