]> Cypherpunks repositories - gostls13.git/commitdiff
cmd/compile: benchmark needs dominator tree
authorKeith Randall <khr@golang.org>
Mon, 23 May 2016 20:09:12 +0000 (13:09 -0700)
committerKeith Randall <khr@golang.org>
Mon, 23 May 2016 20:21:15 +0000 (20:21 +0000)
Now that CSE uses dom tree to order partitions, we need the
dom tree computed before benchmarking CSE.

Fixes #15801

Change-Id: Ifa4702c7b75250f34de185e69a880b3f3cc46a12
Reviewed-on: https://go-review.googlesource.com/23361
Reviewed-by: David Chase <drchase@google.com>
src/cmd/compile/internal/ssa/passbm_test.go

index 8dff17a5b413fb11a60170ceb31764b4fba31780..87069abc3b1b9f79d9e89e4c202eac82ed23f142 100644 (file)
@@ -35,7 +35,7 @@ func benchFnPass(b *testing.B, fn passFunc, size int, bg blockGen) {
        b.ReportAllocs()
        c := NewConfig("amd64", DummyFrontend{b}, nil, true)
        fun := Fun(c, "entry", bg(size)...)
-
+       domTree(fun.f)
        CheckFunc(fun.f)
        b.ResetTimer()
        for i := 0; i < b.N; i++ {
@@ -51,7 +51,7 @@ func benchFnBlock(b *testing.B, fn passFunc, bg blockGen) {
        b.ReportAllocs()
        c := NewConfig("amd64", DummyFrontend{b}, nil, true)
        fun := Fun(c, "entry", bg(b.N)...)
-
+       domTree(fun.f)
        CheckFunc(fun.f)
        b.ResetTimer()
        for i := 0; i < passCount; i++ {