aboutsummaryrefslogtreecommitdiff
path: root/src/cmd/compile/internal/ssa/fuse_test.go
diff options
context:
space:
mode:
authorJosh Bleecher Snyder <josharian@gmail.com>2017-03-16 22:42:10 -0700
committerJosh Bleecher Snyder <josharian@gmail.com>2017-03-17 23:18:57 +0000
commit2cdb7f118ab86adb6fef5485d96831df3446b747 (patch)
tree646fbcb5434a3efd5ded903b36cef37c0c4ac3ad /src/cmd/compile/internal/ssa/fuse_test.go
parent193510f2f6a0d01bb03595ba12dd2b05109980e3 (diff)
downloadgo-2cdb7f118ab86adb6fef5485d96831df3446b747.tar.gz
go-2cdb7f118ab86adb6fef5485d96831df3446b747.zip
cmd/compile: move Frontend field from ssa.Config to ssa.Func
Suggested by mdempsky in CL 38232. This allows us to use the Frontend field to associate frontend state and information with a function. See the following CL in the series for examples. This is a giant CL, but it is almost entirely routine refactoring. The ssa test API is starting to feel a bit unwieldy. I will clean it up separately, once the dust has settled. Passes toolstash -cmp. Updates #15756 Change-Id: I71c573bd96ff7251935fce1391b06b1f133c3caf Reviewed-on: https://go-review.googlesource.com/38327 Run-TryBot: Josh Bleecher Snyder <josharian@gmail.com> Reviewed-by: Matthew Dempsky <mdempsky@google.com>
Diffstat (limited to 'src/cmd/compile/internal/ssa/fuse_test.go')
-rw-r--r--src/cmd/compile/internal/ssa/fuse_test.go18
1 files changed, 9 insertions, 9 deletions
diff --git a/src/cmd/compile/internal/ssa/fuse_test.go b/src/cmd/compile/internal/ssa/fuse_test.go
index cf21ac468f..803cde50f2 100644
--- a/src/cmd/compile/internal/ssa/fuse_test.go
+++ b/src/cmd/compile/internal/ssa/fuse_test.go
@@ -8,8 +8,8 @@ import (
func TestFuseEliminatesOneBranch(t *testing.T) {
ptrType := &TypeImpl{Size_: 8, Ptr: true, Name: "testptr"} // dummy for testing
- c := NewConfig("amd64", DummyFrontend{t}, nil, true)
- fun := Fun(c, "entry",
+ c := NewConfig("amd64", nil, true)
+ fun := Fun(c, DummyFrontend{t}, "entry",
Bloc("entry",
Valu("mem", OpInitMem, TypeMem, 0, nil),
Valu("sb", OpSB, TypeInvalid, 0, nil),
@@ -36,8 +36,8 @@ func TestFuseEliminatesOneBranch(t *testing.T) {
func TestFuseEliminatesBothBranches(t *testing.T) {
ptrType := &TypeImpl{Size_: 8, Ptr: true, Name: "testptr"} // dummy for testing
- c := NewConfig("amd64", DummyFrontend{t}, nil, true)
- fun := Fun(c, "entry",
+ c := NewConfig("amd64", nil, true)
+ fun := Fun(c, DummyFrontend{t}, "entry",
Bloc("entry",
Valu("mem", OpInitMem, TypeMem, 0, nil),
Valu("sb", OpSB, TypeInvalid, 0, nil),
@@ -69,8 +69,8 @@ func TestFuseEliminatesBothBranches(t *testing.T) {
func TestFuseHandlesPhis(t *testing.T) {
ptrType := &TypeImpl{Size_: 8, Ptr: true, Name: "testptr"} // dummy for testing
- c := NewConfig("amd64", DummyFrontend{t}, nil, true)
- fun := Fun(c, "entry",
+ c := NewConfig("amd64", nil, true)
+ fun := Fun(c, DummyFrontend{t}, "entry",
Bloc("entry",
Valu("mem", OpInitMem, TypeMem, 0, nil),
Valu("sb", OpSB, TypeInvalid, 0, nil),
@@ -102,8 +102,8 @@ func TestFuseHandlesPhis(t *testing.T) {
}
func TestFuseEliminatesEmptyBlocks(t *testing.T) {
- c := NewConfig("amd64", DummyFrontend{t}, nil, true)
- fun := Fun(c, "entry",
+ c := NewConfig("amd64", nil, true)
+ fun := Fun(c, DummyFrontend{t}, "entry",
Bloc("entry",
Valu("mem", OpInitMem, TypeMem, 0, nil),
Valu("sb", OpSB, TypeInvalid, 0, nil),
@@ -160,7 +160,7 @@ func BenchmarkFuse(b *testing.B) {
b.ResetTimer()
for i := 0; i < b.N; i++ {
- fun := Fun(c, "entry", blocks...)
+ fun := Fun(c, DummyFrontend{b}, "entry", blocks...)
fuse(fun.f)
}
})