aboutsummaryrefslogtreecommitdiff
path: root/src/cmd/compile/internal/ssa/stackalloc.go
diff options
context:
space:
mode:
Diffstat (limited to 'src/cmd/compile/internal/ssa/stackalloc.go')
-rw-r--r--src/cmd/compile/internal/ssa/stackalloc.go9
1 files changed, 5 insertions, 4 deletions
diff --git a/src/cmd/compile/internal/ssa/stackalloc.go b/src/cmd/compile/internal/ssa/stackalloc.go
index 8caf50494e..3b44986eee 100644
--- a/src/cmd/compile/internal/ssa/stackalloc.go
+++ b/src/cmd/compile/internal/ssa/stackalloc.go
@@ -7,6 +7,7 @@
package ssa
import (
+ "cmd/compile/internal/types"
"cmd/internal/src"
"fmt"
)
@@ -68,7 +69,7 @@ func putStackAllocState(s *stackAllocState) {
}
type stackValState struct {
- typ Type
+ typ *types.Type
spill *Value
needSlot bool
}
@@ -162,7 +163,7 @@ func (s *stackAllocState) stackalloc() {
// TODO: share slots among equivalent types. We would need to
// only share among types with the same GC signature. See the
// type.Equal calls below for where this matters.
- locations := map[Type][]LocalSlot{}
+ locations := map[*types.Type][]LocalSlot{}
// Each time we assign a stack slot to a value v, we remember
// the slot we used via an index into locations[v.Type].
@@ -204,7 +205,7 @@ func (s *stackAllocState) stackalloc() {
} else {
name = names[v.ID]
}
- if name.N != nil && v.Type.Compare(name.Type) == CMPeq {
+ if name.N != nil && v.Type.Compare(name.Type) == types.CMPeq {
for _, id := range s.interfere[v.ID] {
h := f.getHome(id)
if h != nil && h.(LocalSlot).N == name.N && h.(LocalSlot).Off == name.Off {
@@ -376,7 +377,7 @@ func (s *stackAllocState) buildInterferenceGraph() {
if s.values[v.ID].needSlot {
live.remove(v.ID)
for _, id := range live.contents() {
- if s.values[v.ID].typ.Compare(s.values[id].typ) == CMPeq {
+ if s.values[v.ID].typ.Compare(s.values[id].typ) == types.CMPeq {
s.interfere[v.ID] = append(s.interfere[v.ID], id)
s.interfere[id] = append(s.interfere[id], v.ID)
}