aboutsummaryrefslogtreecommitdiff
path: root/src/cmd/compile/internal/ssa/deadcode.go
diff options
context:
space:
mode:
authorKeith Randall <khr@golang.org>2016-01-28 13:46:30 -0800
committerKeith Randall <khr@golang.org>2016-01-28 22:52:42 +0000
commit2f57d0fe024c19b1b7a86084d72e7267863415a6 (patch)
tree3059943f68bf02870be721507954f5a05d7c029d /src/cmd/compile/internal/ssa/deadcode.go
parent6a96a2fe5a95375e2f8cccca6d848728fef0e09f (diff)
downloadgo-2f57d0fe024c19b1b7a86084d72e7267863415a6.tar.gz
go-2f57d0fe024c19b1b7a86084d72e7267863415a6.zip
[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>
Diffstat (limited to 'src/cmd/compile/internal/ssa/deadcode.go')
-rw-r--r--src/cmd/compile/internal/ssa/deadcode.go6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/cmd/compile/internal/ssa/deadcode.go b/src/cmd/compile/internal/ssa/deadcode.go
index 429708213f..faf16a3816 100644
--- a/src/cmd/compile/internal/ssa/deadcode.go
+++ b/src/cmd/compile/internal/ssa/deadcode.go
@@ -164,7 +164,7 @@ func deadcode(f *Func) {
f.Names = f.Names[:i]
// Remove dead values from blocks' value list. Return dead
- // value ids to the allocator.
+ // values to the allocator.
for _, b := range f.Blocks {
i := 0
for _, v := range b.Values {
@@ -172,7 +172,7 @@ func deadcode(f *Func) {
b.Values[i] = v
i++
} else {
- f.vid.put(v.ID)
+ f.freeValue(v)
}
}
// aid GC
@@ -197,7 +197,7 @@ func deadcode(f *Func) {
b.Succs = nil
b.Control = nil
b.Kind = BlockDead
- f.bid.put(b.ID)
+ f.freeBlock(b)
}
}
// zero remainder to help GC