diff options
author | Cherry Zhang <cherryyz@google.com> | 2017-02-09 09:46:44 -0500 |
---|---|---|
committer | Cherry Zhang <cherryyz@google.com> | 2017-03-16 14:22:53 +0000 |
commit | 211c8c9f1a1d11a6f5c42e85ec78cd06a69fbe0c (patch) | |
tree | 8f215f2a67b4e8d40f599bcddb4ce7a96c5808d1 /src/cmd/compile/internal/ssa/rewritedec64.go | |
parent | 77b09b8b8dc9d27f0c583f4eb94a563e68fe0af6 (diff) | |
download | go-211c8c9f1a1d11a6f5c42e85ec78cd06a69fbe0c.tar.gz go-211c8c9f1a1d11a6f5c42e85ec78cd06a69fbe0c.zip |
cmd/compile: pass types on SSA Store/Move/Zero ops
For SSA Store/Move/Zero ops, attach the type of the value being
stored to the op as the Aux field. This type will be used for
write barrier insertion (in a followup CL). Since SSA passes
do not accurately propagate types of values (because of type
casting), we can't simply use type of the store's arguments
for write barrier insertion.
Passes "toolstash -cmp" on std.
Updates #17583.
Change-Id: I051d5e5c482931640d1d7d879b2a6bb91f2e0056
Reviewed-on: https://go-review.googlesource.com/36838
Run-TryBot: Cherry Zhang <cherryyz@google.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Keith Randall <khr@golang.org>
Diffstat (limited to 'src/cmd/compile/internal/ssa/rewritedec64.go')
-rw-r--r-- | src/cmd/compile/internal/ssa/rewritedec64.go | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/src/cmd/compile/internal/ssa/rewritedec64.go b/src/cmd/compile/internal/ssa/rewritedec64.go index d04676fadb..be1684030d 100644 --- a/src/cmd/compile/internal/ssa/rewritedec64.go +++ b/src/cmd/compile/internal/ssa/rewritedec64.go @@ -2398,7 +2398,7 @@ func rewriteValuedec64_OpStore(v *Value, config *Config) bool { _ = b // match: (Store [8] dst (Int64Make hi lo) mem) // cond: !config.BigEndian - // result: (Store [4] (OffPtr <hi.Type.PtrTo()> [4] dst) hi (Store [4] dst lo mem)) + // result: (Store [4] {hi.Type} (OffPtr <hi.Type.PtrTo()> [4] dst) hi (Store [4] {lo.Type} dst lo mem)) for { if v.AuxInt != 8 { break @@ -2416,6 +2416,7 @@ func rewriteValuedec64_OpStore(v *Value, config *Config) bool { } v.reset(OpStore) v.AuxInt = 4 + v.Aux = hi.Type v0 := b.NewValue0(v.Pos, OpOffPtr, hi.Type.PtrTo()) v0.AuxInt = 4 v0.AddArg(dst) @@ -2423,6 +2424,7 @@ func rewriteValuedec64_OpStore(v *Value, config *Config) bool { v.AddArg(hi) v1 := b.NewValue0(v.Pos, OpStore, TypeMem) v1.AuxInt = 4 + v1.Aux = lo.Type v1.AddArg(dst) v1.AddArg(lo) v1.AddArg(mem) @@ -2431,7 +2433,7 @@ func rewriteValuedec64_OpStore(v *Value, config *Config) bool { } // match: (Store [8] dst (Int64Make hi lo) mem) // cond: config.BigEndian - // result: (Store [4] (OffPtr <lo.Type.PtrTo()> [4] dst) lo (Store [4] dst hi mem)) + // result: (Store [4] {lo.Type} (OffPtr <lo.Type.PtrTo()> [4] dst) lo (Store [4] {hi.Type} dst hi mem)) for { if v.AuxInt != 8 { break @@ -2449,6 +2451,7 @@ func rewriteValuedec64_OpStore(v *Value, config *Config) bool { } v.reset(OpStore) v.AuxInt = 4 + v.Aux = lo.Type v0 := b.NewValue0(v.Pos, OpOffPtr, lo.Type.PtrTo()) v0.AuxInt = 4 v0.AddArg(dst) @@ -2456,6 +2459,7 @@ func rewriteValuedec64_OpStore(v *Value, config *Config) bool { v.AddArg(lo) v1 := b.NewValue0(v.Pos, OpStore, TypeMem) v1.AuxInt = 4 + v1.Aux = hi.Type v1.AddArg(dst) v1.AddArg(hi) v1.AddArg(mem) |