[dev.ssa] cmd/compile: preallocate small-numbered values and blocks

Speeds up the compiler ~5%.

Change-Id: Ia5cf0bcd58701fd14018ec77d01f03d5c7d6385b
Reviewed-on: https://go-review.googlesource.com/19060
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
This commit is contained in:
Keith Randall 2016-01-28 13:46:30 -08:00
parent 6a96a2fe5a
commit 2f57d0fe02
8 changed files with 168 additions and 176 deletions

View file

@ -964,9 +964,7 @@ func (s *regAllocState) regalloc(f *Func) {
// Constants, SP, SB, ...
continue
}
spill.Op = OpInvalid
spill.Type = TypeInvalid
spill.resetArgs()
f.freeValue(spill)
}
for _, b := range f.Blocks {
i := 0