diff options
| author | Keith Randall <khr@golang.org> | 2015-06-11 21:29:25 -0700 |
|---|---|---|
| committer | Keith Randall <khr@golang.org> | 2015-06-14 06:00:30 +0000 |
| commit | 8f22b5292ffc01ea66bd92fa833d0ec25390173b (patch) | |
| tree | eab351402863ba4b83ff3ba3cd173491d244a291 /src/cmd/compile/internal/ssa/stackalloc.go | |
| parent | 0ad9c8c720324b6c4e483ac7fe0e20f36274e2eb (diff) | |
| download | go-8f22b5292ffc01ea66bd92fa833d0ec25390173b.tar.xz | |
[dev.ssa] cmd/compiler/internal/ssa: Add auxint field
Add an additional int64 auxiliary field to Value.
There are two main reasons for doing this:
1) Ints in interfaces require allocation, and we store ints in Aux a lot.
2) I'd like to have both *gc.Sym and int offsets included in lots
of operations (e.g. MOVQloadidx8). It will be more efficient to
store them as separate fields instead of a pointer to a sym/int pair.
It also simplifies a bunch of code.
This is just the refactoring. I'll start using this some more in a
subsequent changelist.
Change-Id: I1ca797ff572553986cf90cab3ac0a0c1d01ad241
Reviewed-on: https://go-review.googlesource.com/10929
Reviewed-by: Josh Bleecher Snyder <josharian@gmail.com>
Diffstat (limited to 'src/cmd/compile/internal/ssa/stackalloc.go')
| -rw-r--r-- | src/cmd/compile/internal/ssa/stackalloc.go | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/cmd/compile/internal/ssa/stackalloc.go b/src/cmd/compile/internal/ssa/stackalloc.go index d47c8c7b02..cb1688f51c 100644 --- a/src/cmd/compile/internal/ssa/stackalloc.go +++ b/src/cmd/compile/internal/ssa/stackalloc.go @@ -92,14 +92,14 @@ func stackalloc(f *Func) { case OpAMD64ADDQ: // (ADDQ (FP) x) -> (LEAQ [n] (SP) x) v.Op = OpAMD64LEAQ - v.Aux = n + v.AuxInt = n case OpAMD64LEAQ, OpAMD64MOVQload, OpAMD64MOVQstore, OpAMD64MOVBload, OpAMD64MOVQloadidx8: if v.Op == OpAMD64MOVQloadidx8 && i == 1 { // Note: we could do it, but it is probably an error log.Panicf("can't do FP->SP adjust on index slot of load %s", v.Op) } // eg: (MOVQload [c] (FP) mem) -> (MOVQload [c+n] (SP) mem) - v.Aux = addOffset(v.Aux.(int64), n) + v.AuxInt = addOff(v.AuxInt, n) default: log.Panicf("can't do FP->SP adjust on %s", v.Op) // TODO: OpCopy -> ADDQ |
