aboutsummaryrefslogtreecommitdiff
path: root/src/cmd/compile/internal/ssa/deadstore_test.go
diff options
context:
space:
mode:
authorKeith Randall <khr@golang.org>2015-06-19 21:02:28 -0700
committerKeith Randall <khr@golang.org>2015-06-25 17:54:18 +0000
commit8c46aa54817063a39dc25bad343d6322e65f8598 (patch)
treec0e3902b66baa3c8671b07e6195337d9b85ff572 /src/cmd/compile/internal/ssa/deadstore_test.go
parent37ddc270ca5360ccde000fd373d49b3450ee8e6e (diff)
downloadgo-8c46aa54817063a39dc25bad343d6322e65f8598.tar.gz
go-8c46aa54817063a39dc25bad343d6322e65f8598.zip
[dev.ssa] cmd/compile/internal/ssa: Handle variables correctly
Use *Node of type ONAME instead of string as the key for variable maps. This will prevent aliasing between two identically named but differently scoped variables. Introduce an Aux value that encodes the offset of a variable from a base pointer (either global base pointer or stack pointer). Allow LEAQ and derivatives (MOVQ, etc.) to also have such an Aux field. Allocate space for AUTO variables in stackalloc. Change-Id: Ibdccdaea4bbc63a1f4882959ac374f2b467e3acd Reviewed-on: https://go-review.googlesource.com/11238 Reviewed-by: Josh Bleecher Snyder <josharian@gmail.com>
Diffstat (limited to 'src/cmd/compile/internal/ssa/deadstore_test.go')
-rw-r--r--src/cmd/compile/internal/ssa/deadstore_test.go10
1 files changed, 5 insertions, 5 deletions
diff --git a/src/cmd/compile/internal/ssa/deadstore_test.go b/src/cmd/compile/internal/ssa/deadstore_test.go
index 48ea066aa3..042e7f66ff 100644
--- a/src/cmd/compile/internal/ssa/deadstore_test.go
+++ b/src/cmd/compile/internal/ssa/deadstore_test.go
@@ -15,8 +15,8 @@ func TestDeadStore(t *testing.T) {
Bloc("entry",
Valu("start", OpArg, TypeMem, 0, ".mem"),
Valu("v", OpConst, TypeBool, 0, true),
- Valu("addr1", OpGlobal, ptrType, 0, nil),
- Valu("addr2", OpGlobal, ptrType, 0, nil),
+ Valu("addr1", OpAddr, ptrType, 0, nil),
+ Valu("addr2", OpAddr, ptrType, 0, nil),
Valu("store1", OpStore, TypeMem, 0, nil, "addr1", "v", "start"),
Valu("store2", OpStore, TypeMem, 0, nil, "addr2", "v", "store1"),
Valu("store3", OpStore, TypeMem, 0, nil, "addr1", "v", "store2"),
@@ -41,7 +41,7 @@ func TestDeadStorePhi(t *testing.T) {
Bloc("entry",
Valu("start", OpArg, TypeMem, 0, ".mem"),
Valu("v", OpConst, TypeBool, 0, true),
- Valu("addr", OpGlobal, ptrType, 0, nil),
+ Valu("addr", OpAddr, ptrType, 0, nil),
Goto("loop")),
Bloc("loop",
Valu("phi", OpPhi, TypeMem, 0, nil, "start", "store"),
@@ -67,8 +67,8 @@ func TestDeadStoreTypes(t *testing.T) {
Bloc("entry",
Valu("start", OpArg, TypeMem, 0, ".mem"),
Valu("v", OpConst, TypeBool, 0, true),
- Valu("addr1", OpGlobal, t1, 0, nil),
- Valu("addr2", OpGlobal, t2, 0, nil),
+ Valu("addr1", OpAddr, t1, 0, nil),
+ Valu("addr2", OpAddr, t2, 0, nil),
Valu("store1", OpStore, TypeMem, 0, nil, "addr1", "v", "start"),
Valu("store2", OpStore, TypeMem, 0, nil, "addr2", "v", "store1"),
Goto("exit")),