Commit 7b8f5118 authored by Matthew Dempsky's avatar Matthew Dempsky

cmd/compile/internal/gc: refactor liveness bitmap generation

Keep liveness bit vectors as simple live-variable vectors during
liveness analysis. We can defer expanding them into runtime heap
bitmaps until we're actually writing out the symbol data, and then we
only need temporary memory to expand one bitmap at a time.

This is logically cleaner (e.g., we no longer depend on stack frame
layout during analysis) and saves a little bit on allocations.

name       old alloc/op    new alloc/op    delta
Template      41.4MB ± 0%     41.3MB ± 0%  -0.28%        (p=0.000 n=60+60)
Unicode       32.6MB ± 0%     32.6MB ± 0%  -0.11%        (p=0.000 n=59+60)
GoTypes        119MB ± 0%      119MB ± 0%  -0.35%        (p=0.000 n=60+59)
Compiler       483MB ± 0%      481MB ± 0%  -0.47%        (p=0.000 n=59+60)

name       old allocs/op   new allocs/op   delta
Template        381k ± 1%       380k ± 1%  -0.32%        (p=0.000 n=60+60)
Unicode         325k ± 1%       325k ± 1%    ~           (p=0.867 n=60+60)
GoTypes        1.16M ± 0%      1.15M ± 0%  -0.40%        (p=0.000 n=60+59)
Compiler       4.22M ± 0%      4.19M ± 0%  -0.61%        (p=0.000 n=59+60)

Passes toolstash -cmp.

Change-Id: I8175efe55201ffb5017f79ae6cb90df03f1b7e99
Reviewed-on: https://go-review.googlesource.com/37458
Run-TryBot: Matthew Dempsky <mdempsky@google.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: default avatarJosh Bleecher Snyder <josharian@gmail.com>
parent 88f423ed
This diff is collapsed.
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment