aboutsummaryrefslogtreecommitdiff
path: root/src/cmd/compile/internal/ssa/export_test.go
diff options
context:
space:
mode:
authorJosh Bleecher Snyder <josharian@gmail.com>2017-03-17 10:50:20 -0700
committerJosh Bleecher Snyder <josharian@gmail.com>2017-03-17 22:35:29 +0000
commit193510f2f6a0d01bb03595ba12dd2b05109980e3 (patch)
treefd81d434a61d0d19a7612a0d40aafd7c8cfbd8fe /src/cmd/compile/internal/ssa/export_test.go
parent09272ae981905dcdc76ab7ffbda996c49d86595c (diff)
downloadgo-193510f2f6a0d01bb03595ba12dd2b05109980e3.tar.gz
go-193510f2f6a0d01bb03595ba12dd2b05109980e3.zip
cmd/compile: evaluate config as needed in rewrite rules
Prior to this CL, config was an explicit argument to the SSA rewrite rules, and rules that needed a Frontend got at it via config. An upcoming CL moves Frontend from Config to Func, so rules can no longer reach Frontend via Config. Passing a Frontend as an argument to the rewrite rules causes a 2-3% regression in compile times. This CL takes a different approach: It treats the variable names "config" and "fe" as special and calculates them as needed. The "as needed part" is also important to performance: If they are calculated eagerly, the nilchecks themselves cause a regression. This introduces a little bit of magic into the rewrite generator. However, from the perspective of the rules, the config variable was already more or less magic. And it makes the upcoming changes much clearer. Passes toolstash -cmp. Change-Id: I173f2bcc124cba43d53138bfa3775e21316a9107 Reviewed-on: https://go-review.googlesource.com/38326 Run-TryBot: Josh Bleecher Snyder <josharian@gmail.com> Reviewed-by: Matthew Dempsky <mdempsky@google.com>
Diffstat (limited to 'src/cmd/compile/internal/ssa/export_test.go')
0 files changed, 0 insertions, 0 deletions