[dev.ssa] cmd/compile: reducing alloc footprint of dominator calc

Converted working slices of pointer into slices of pointer
index.  Half the size (on 64-bit machine) and no pointers
to trace if GC occurs while they're live.

TODO - could expose slice mapping ID->*Block; some dom
clients also construct these.

Minor optimization in regalloc that cuts allocation count.

Minor optimization in compile.go that cuts calls to Sprintf.

Change-Id: I28f0bfed422b7344af333dc52ea272441e28e463
Reviewed-on: https://go-review.googlesource.com/19104
Run-TryBot: Todd Neal <todd@tneal.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Todd Neal <todd@tneal.org>
This commit is contained in:
David Chase 2016-01-30 17:37:38 -05:00
parent 25abe96214
commit c87a62f32b
3 changed files with 74 additions and 63 deletions

View file

@ -1624,6 +1624,9 @@ func (s *regAllocState) computeLive() {
}
// The live set has changed, update it.
l := s.live[p.ID][:0]
if cap(l) == 0 {
l = make([]liveInfo, 0, len(t.contents()))
}
for _, e := range t.contents() {
l = append(l, liveInfo{e.key, e.val})
}