cmd/compile: reduce allocations in prove by reusing posets

In prove, reuse posets between different functions by storing them
in the per-worker cache.

Allocation count regression caused by prove improvements is down
from 5% to 3% after this CL.

Updates #25179

Change-Id: I6d14003109833d9b3ef5165fdea00aa9c9e952e8
Reviewed-on: https://go-review.googlesource.com/110455
Run-TryBot: Giovanni Bajo <rasky@develer.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: David Chase <drchase@google.com>
This commit is contained in:
Giovanni Bajo 2018-05-01 00:57:57 +02:00
parent 67656ba71b
commit 3c8545c5f6
5 changed files with 48 additions and 11 deletions

View file

@ -64,7 +64,8 @@ func testPosetOps(t *testing.T, unsigned bool, ops []posetTestOp) {
}
}
po := newPoset(unsigned)
po := newPoset()
po.SetUnsigned(unsigned)
for idx, op := range ops {
t.Logf("op%d%v", idx, op)
switch op.typ {