aboutsummaryrefslogtreecommitdiff
path: root/src/cmd/compile/internal/ssa/export_test.go
diff options
context:
space:
mode:
authorKeith Randall <khr@golang.org>2016-04-27 16:58:50 -0700
committerKeith Randall <khr@golang.org>2016-04-28 17:40:08 +0000
commitd610d304f86021cc5f388b8f02d99bc73fca0d9b (patch)
tree128ec7a4ebab229ae9f6c6cb26ed6bbf2347dd86 /src/cmd/compile/internal/ssa/export_test.go
parent5ec87ba554c2a83cdc188724f815e53fede91b66 (diff)
downloadgo-d610d304f86021cc5f388b8f02d99bc73fca0d9b.tar.gz
go-d610d304f86021cc5f388b8f02d99bc73fca0d9b.zip
cmd/compile: reorg copyelim to avoid O(n^2) problem
Make sure we don't do O(n^2) work to eliminate a chain of n copies. benchmark old ns/op new ns/op delta BenchmarkCopyElim1-8 1418 1406 -0.85% BenchmarkCopyElim10-8 5289 5162 -2.40% BenchmarkCopyElim100-8 52618 41684 -20.78% BenchmarkCopyElim1000-8 2473878 424339 -82.85% BenchmarkCopyElim10000-8 269373954 6367971 -97.64% BenchmarkCopyElim100000-8 31272781165 104357244 -99.67% Change-Id: I680f906f70f2ee1a8615cb1046bc510c77d59284 Reviewed-on: https://go-review.googlesource.com/22535 Reviewed-by: Alexandru Moșoi <alexandru@mosoi.ro>
Diffstat (limited to 'src/cmd/compile/internal/ssa/export_test.go')
-rw-r--r--src/cmd/compile/internal/ssa/export_test.go3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/cmd/compile/internal/ssa/export_test.go b/src/cmd/compile/internal/ssa/export_test.go
index 0a67de9f05..27892a8dc1 100644
--- a/src/cmd/compile/internal/ssa/export_test.go
+++ b/src/cmd/compile/internal/ssa/export_test.go
@@ -13,8 +13,9 @@ var CheckFunc = checkFunc
var PrintFunc = printFunc
var Opt = opt
var Deadcode = deadcode
+var Copyelim = copyelim
-func testConfig(t *testing.T) *Config {
+func testConfig(t testing.TB) *Config {
testCtxt := &obj.Link{}
return NewConfig("amd64", DummyFrontend{t}, testCtxt, true)
}