[dev.ssa] cmd/compiler/internal/ssa: Add auxint field
Add an additional int64 auxiliary field to Value.
There are two main reasons for doing this:
1) Ints in interfaces require allocation, and we store ints in Aux a lot.
2) I'd like to have both *gc.Sym and int offsets included in lots
of operations (e.g. MOVQloadidx8). It will be more efficient to
store them as separate fields instead of a pointer to a sym/int pair.
It also simplifies a bunch of code.
This is just the refactoring. I'll start using this some more in a
subsequent changelist.
Change-Id: I1ca797ff572553986cf90cab3ac0a0c1d01ad241
Reviewed-on: https://go-review.googlesource.com/10929
Reviewed-by: Josh Bleecher Snyder <josharian@gmail.com>
diff --git a/src/cmd/compile/internal/ssa/deadstore_test.go b/src/cmd/compile/internal/ssa/deadstore_test.go
index 70b2092..5143afb 100644
--- a/src/cmd/compile/internal/ssa/deadstore_test.go
+++ b/src/cmd/compile/internal/ssa/deadstore_test.go
@@ -13,13 +13,13 @@
ptrType := &TypeImpl{Size_: 8, Ptr: true, Name: "testptr"} // dummy for testing
fun := Fun(c, "entry",
Bloc("entry",
- Valu("start", OpArg, TypeMem, ".mem"),
- Valu("v", OpConst, TypeBool, true),
- Valu("addr1", OpGlobal, ptrType, nil),
- Valu("addr2", OpGlobal, ptrType, nil),
- Valu("store1", OpStore, TypeMem, nil, "addr1", "v", "start"),
- Valu("store2", OpStore, TypeMem, nil, "addr2", "v", "store1"),
- Valu("store3", OpStore, TypeMem, nil, "addr1", "v", "store2"),
+ 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("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"),
Goto("exit")),
Bloc("exit",
Exit("store3")))
@@ -39,13 +39,13 @@
ptrType := &TypeImpl{Size_: 8, Ptr: true, Name: "testptr"} // dummy for testing
fun := Fun(c, "entry",
Bloc("entry",
- Valu("start", OpArg, TypeMem, ".mem"),
- Valu("v", OpConst, TypeBool, true),
- Valu("addr", OpGlobal, ptrType, nil),
+ Valu("start", OpArg, TypeMem, 0, ".mem"),
+ Valu("v", OpConst, TypeBool, 0, true),
+ Valu("addr", OpGlobal, ptrType, 0, nil),
Goto("loop")),
Bloc("loop",
- Valu("phi", OpPhi, TypeMem, nil, "start", "store"),
- Valu("store", OpStore, TypeMem, nil, "addr", "v", "phi"),
+ Valu("phi", OpPhi, TypeMem, 0, nil, "start", "store"),
+ Valu("store", OpStore, TypeMem, 0, nil, "addr", "v", "phi"),
If("v", "loop", "exit")),
Bloc("exit",
Exit("store")))
@@ -65,12 +65,12 @@
t2 := &TypeImpl{Size_: 4, Ptr: true, Name: "t2"}
fun := Fun(c, "entry",
Bloc("entry",
- Valu("start", OpArg, TypeMem, ".mem"),
- Valu("v", OpConst, TypeBool, true),
- Valu("addr1", OpGlobal, t1, nil),
- Valu("addr2", OpGlobal, t2, nil),
- Valu("store1", OpStore, TypeMem, nil, "addr1", "v", "start"),
- Valu("store2", OpStore, TypeMem, nil, "addr2", "v", "store1"),
+ 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("store1", OpStore, TypeMem, 0, nil, "addr1", "v", "start"),
+ Valu("store2", OpStore, TypeMem, 0, nil, "addr2", "v", "store1"),
Goto("exit")),
Bloc("exit",
Exit("store2")))