aboutsummaryrefslogtreecommitdiff
path: root/src/cmd/compile/internal/ssa/regalloc_test.go
diff options
context:
space:
mode:
authorKeith Randall <khr@golang.org>2015-12-09 15:58:18 -0800
committerKeith Randall <khr@golang.org>2015-12-11 21:08:15 +0000
commitc140df03267ab2e73ffd076002811aaa00fdc80e (patch)
treedffa2bec2304a31c1be5259506abb8fc5d453a41 /src/cmd/compile/internal/ssa/regalloc_test.go
parent09ffa0c4c772ff119d42820a8d90aba8b481397c (diff)
downloadgo-c140df03267ab2e73ffd076002811aaa00fdc80e.tar.gz
go-c140df03267ab2e73ffd076002811aaa00fdc80e.zip
[dev.ssa] cmd/compile: allocate the flag register in a separate pass
Spilling/restoring flag values is a pain to do during regalloc. Instead, allocate the flag register in a separate pass. Regalloc then operates normally on any flag recomputation instructions. Change-Id: Ia1c3d9e6eff678861193093c0b48a00f90e4156b Reviewed-on: https://go-review.googlesource.com/17694 Reviewed-by: David Chase <drchase@google.com>
Diffstat (limited to 'src/cmd/compile/internal/ssa/regalloc_test.go')
-rw-r--r--src/cmd/compile/internal/ssa/regalloc_test.go9
1 files changed, 5 insertions, 4 deletions
diff --git a/src/cmd/compile/internal/ssa/regalloc_test.go b/src/cmd/compile/internal/ssa/regalloc_test.go
index 08260fbbbb..596a920858 100644
--- a/src/cmd/compile/internal/ssa/regalloc_test.go
+++ b/src/cmd/compile/internal/ssa/regalloc_test.go
@@ -13,12 +13,12 @@ func TestLiveControlOps(t *testing.T) {
Valu("mem", OpInitMem, TypeMem, 0, ".mem"),
Valu("x", OpAMD64MOVBconst, TypeInt8, 0, 1),
Valu("y", OpAMD64MOVBconst, TypeInt8, 0, 2),
- Valu("a", OpAMD64TESTB, TypeBool, 0, nil, "x", "y"),
- Valu("b", OpAMD64TESTB, TypeBool, 0, nil, "y", "x"),
- If("a", "if", "exit"),
+ Valu("a", OpAMD64TESTB, TypeFlags, 0, nil, "x", "y"),
+ Valu("b", OpAMD64TESTB, TypeFlags, 0, nil, "y", "x"),
+ Eq("a", "if", "exit"),
),
Bloc("if",
- If("b", "plain", "exit"),
+ Eq("b", "plain", "exit"),
),
Bloc("plain",
Goto("exit"),
@@ -27,6 +27,7 @@ func TestLiveControlOps(t *testing.T) {
Exit("mem"),
),
)
+ flagalloc(f.f)
regalloc(f.f)
checkFunc(f.f)
}