diff options
author | Josh Bleecher Snyder <josharian@gmail.com> | 2017-03-18 10:16:03 -0700 |
---|---|---|
committer | Josh Bleecher Snyder <josharian@gmail.com> | 2017-03-19 02:03:44 +0000 |
commit | 872db7998937b310635a99055e066904425559bb (patch) | |
tree | b560c8840f8b3294956eb72b5f805a25ea874dfc /src/cmd/compile/internal/ssa | |
parent | aea3aff66911e31cba9eddd93c02eb591ae483bf (diff) | |
download | go-872db7998937b310635a99055e066904425559bb.tar.gz go-872db7998937b310635a99055e066904425559bb.zip |
cmd/compile: add more types to ssa.Types
This reduces the number of calls back into the
gc Type routines, which will help performance
in a concurrent backend.
It also reduces the number of callsites
that must be considered in making the transition.
Passes toolstash-check -all. No compiler performance changes.
Updates #15756
Change-Id: Ic7a8f1daac7e01a21658ae61ac118b2a70804117
Reviewed-on: https://go-review.googlesource.com/38340
Run-TryBot: Josh Bleecher Snyder <josharian@gmail.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Matthew Dempsky <mdempsky@google.com>
Diffstat (limited to 'src/cmd/compile/internal/ssa')
-rw-r--r-- | src/cmd/compile/internal/ssa/config.go | 37 | ||||
-rw-r--r-- | src/cmd/compile/internal/ssa/export_test.go | 37 | ||||
-rw-r--r-- | src/cmd/compile/internal/ssa/gen/MIPS.rules | 8 | ||||
-rw-r--r-- | src/cmd/compile/internal/ssa/gen/dec.rules | 24 | ||||
-rw-r--r-- | src/cmd/compile/internal/ssa/gen/dec64.rules | 8 | ||||
-rw-r--r-- | src/cmd/compile/internal/ssa/rewriteMIPS.go | 16 | ||||
-rw-r--r-- | src/cmd/compile/internal/ssa/rewritedec.go | 44 | ||||
-rw-r--r-- | src/cmd/compile/internal/ssa/rewritedec64.go | 16 | ||||
-rw-r--r-- | src/cmd/compile/internal/ssa/writebarrier.go | 2 |
9 files changed, 103 insertions, 89 deletions
diff --git a/src/cmd/compile/internal/ssa/config.go b/src/cmd/compile/internal/ssa/config.go index 7c49abba92..ab541ccafc 100644 --- a/src/cmd/compile/internal/ssa/config.go +++ b/src/cmd/compile/internal/ssa/config.go @@ -46,21 +46,28 @@ type ( ) type Types struct { - Bool Type - Int8 Type - Int16 Type - Int32 Type - Int64 Type - UInt8 Type - UInt16 Type - UInt32 Type - UInt64 Type - Int Type - Float32 Type - Float64 Type - Uintptr Type - String Type - BytePtr Type // TODO: use unsafe.Pointer instead? + Bool Type + Int8 Type + Int16 Type + Int32 Type + Int64 Type + UInt8 Type + UInt16 Type + UInt32 Type + UInt64 Type + Int Type + Float32 Type + Float64 Type + Uintptr Type + String Type + BytePtr Type // TODO: use unsafe.Pointer instead? + Int32Ptr Type + UInt32Ptr Type + IntPtr Type + UintptrPtr Type + Float32Ptr Type + Float64Ptr Type + BytePtrPtr Type } type Logger interface { diff --git a/src/cmd/compile/internal/ssa/export_test.go b/src/cmd/compile/internal/ssa/export_test.go index b04702d279..33e0ffb416 100644 --- a/src/cmd/compile/internal/ssa/export_test.go +++ b/src/cmd/compile/internal/ssa/export_test.go @@ -102,21 +102,28 @@ func (d DummyFrontend) Debug_checknil() bool { ret func (d DummyFrontend) Debug_wb() bool { return false } var dummyTypes = Types{ - Bool: TypeBool, - Int8: TypeInt8, - Int16: TypeInt16, - Int32: TypeInt32, - Int64: TypeInt64, - UInt8: TypeUInt8, - UInt16: TypeUInt16, - UInt32: TypeUInt32, - UInt64: TypeUInt64, - Float32: TypeFloat32, - Float64: TypeFloat64, - Int: TypeInt64, - Uintptr: TypeUInt64, - String: nil, - BytePtr: TypeBytePtr, + Bool: TypeBool, + Int8: TypeInt8, + Int16: TypeInt16, + Int32: TypeInt32, + Int64: TypeInt64, + UInt8: TypeUInt8, + UInt16: TypeUInt16, + UInt32: TypeUInt32, + UInt64: TypeUInt64, + Float32: TypeFloat32, + Float64: TypeFloat64, + Int: TypeInt64, + Uintptr: TypeUInt64, + String: nil, + BytePtr: TypeBytePtr, + Int32Ptr: TypeInt32.PtrTo(), + UInt32Ptr: TypeUInt32.PtrTo(), + IntPtr: TypeInt64.PtrTo(), + UintptrPtr: TypeUInt64.PtrTo(), + Float32Ptr: TypeFloat32.PtrTo(), + Float64Ptr: TypeFloat64.PtrTo(), + BytePtrPtr: TypeBytePtr.PtrTo(), } func (d DummyFrontend) DerefItab(sym *obj.LSym, off int64) *obj.LSym { return nil } diff --git a/src/cmd/compile/internal/ssa/gen/MIPS.rules b/src/cmd/compile/internal/ssa/gen/MIPS.rules index f1ece56474..fe6f182ca4 100644 --- a/src/cmd/compile/internal/ssa/gen/MIPS.rules +++ b/src/cmd/compile/internal/ssa/gen/MIPS.rules @@ -393,14 +393,14 @@ // AtomicOr8(ptr,val) -> LoweredAtomicOr(ptr&^3,uint32(val) << ((ptr & 3) * 8)) (AtomicOr8 ptr val mem) && !config.BigEndian -> - (LoweredAtomicOr (AND <types.UInt32.PtrTo()> (MOVWconst [^3]) ptr) + (LoweredAtomicOr (AND <types.UInt32Ptr> (MOVWconst [^3]) ptr) (SLL <types.UInt32> (ZeroExt8to32 val) (SLLconst <types.UInt32> [3] (ANDconst <types.UInt32> [3] ptr))) mem) // AtomicAnd8(ptr,val) -> LoweredAtomicAnd(ptr&^3,(uint32(val) << ((ptr & 3) * 8)) | ^(uint32(0xFF) << ((ptr & 3) * 8)))) (AtomicAnd8 ptr val mem) && !config.BigEndian -> - (LoweredAtomicAnd (AND <types.UInt32.PtrTo()> (MOVWconst [^3]) ptr) + (LoweredAtomicAnd (AND <types.UInt32Ptr> (MOVWconst [^3]) ptr) (OR <types.UInt32> (SLL <types.UInt32> (ZeroExt8to32 val) (SLLconst <types.UInt32> [3] (ANDconst <types.UInt32> [3] ptr))) @@ -411,7 +411,7 @@ // AtomicOr8(ptr,val) -> LoweredAtomicOr(ptr&^3,uint32(val) << (((ptr^3) & 3) * 8)) (AtomicOr8 ptr val mem) && config.BigEndian -> - (LoweredAtomicOr (AND <types.UInt32.PtrTo()> (MOVWconst [^3]) ptr) + (LoweredAtomicOr (AND <types.UInt32Ptr> (MOVWconst [^3]) ptr) (SLL <types.UInt32> (ZeroExt8to32 val) (SLLconst <types.UInt32> [3] (ANDconst <types.UInt32> [3] @@ -419,7 +419,7 @@ // AtomicAnd8(ptr,val) -> LoweredAtomicAnd(ptr&^3,(uint32(val) << (((ptr^3) & 3) * 8)) | ^(uint32(0xFF) << (((ptr^3) & 3) * 8)))) (AtomicAnd8 ptr val mem) && config.BigEndian -> - (LoweredAtomicAnd (AND <types.UInt32.PtrTo()> (MOVWconst [^3]) ptr) + (LoweredAtomicAnd (AND <types.UInt32Ptr> (MOVWconst [^3]) ptr) (OR <types.UInt32> (SLL <types.UInt32> (ZeroExt8to32 val) (SLLconst <types.UInt32> [3] (ANDconst <types.UInt32> [3] diff --git a/src/cmd/compile/internal/ssa/gen/dec.rules b/src/cmd/compile/internal/ssa/gen/dec.rules index 08935d92b4..377edba724 100644 --- a/src/cmd/compile/internal/ssa/gen/dec.rules +++ b/src/cmd/compile/internal/ssa/gen/dec.rules @@ -15,24 +15,24 @@ (ComplexMake (Load <types.Float32> ptr mem) (Load <types.Float32> - (OffPtr <types.Float32.PtrTo()> [4] ptr) + (OffPtr <types.Float32Ptr> [4] ptr) mem) ) (Store {t} dst (ComplexMake real imag) mem) && t.(Type).Size() == 8 -> (Store {types.Float32} - (OffPtr <types.Float32.PtrTo()> [4] dst) + (OffPtr <types.Float32Ptr> [4] dst) imag (Store {types.Float32} dst real mem)) (Load <t> ptr mem) && t.IsComplex() && t.Size() == 16 -> (ComplexMake (Load <types.Float64> ptr mem) (Load <types.Float64> - (OffPtr <types.Float64.PtrTo()> [8] ptr) + (OffPtr <types.Float64Ptr> [8] ptr) mem) ) (Store {t} dst (ComplexMake real imag) mem) && t.(Type).Size() == 16 -> (Store {types.Float64} - (OffPtr <types.Float64.PtrTo()> [8] dst) + (OffPtr <types.Float64Ptr> [8] dst) imag (Store {types.Float64} dst real mem)) @@ -44,11 +44,11 @@ (StringMake (Load <types.BytePtr> ptr mem) (Load <types.Int> - (OffPtr <types.Int.PtrTo()> [config.PtrSize] ptr) + (OffPtr <types.IntPtr> [config.PtrSize] ptr) mem)) (Store dst (StringMake ptr len) mem) -> (Store {types.Int} - (OffPtr <types.Int.PtrTo()> [config.PtrSize] dst) + (OffPtr <types.IntPtr> [config.PtrSize] dst) len (Store {types.BytePtr} dst ptr mem)) @@ -61,17 +61,17 @@ (SliceMake (Load <t.ElemType().PtrTo()> ptr mem) (Load <types.Int> - (OffPtr <types.Int.PtrTo()> [config.PtrSize] ptr) + (OffPtr <types.IntPtr> [config.PtrSize] ptr) mem) (Load <types.Int> - (OffPtr <types.Int.PtrTo()> [2*config.PtrSize] ptr) + (OffPtr <types.IntPtr> [2*config.PtrSize] ptr) mem)) (Store dst (SliceMake ptr len cap) mem) -> (Store {types.Int} - (OffPtr <types.Int.PtrTo()> [2*config.PtrSize] dst) + (OffPtr <types.IntPtr> [2*config.PtrSize] dst) cap (Store {types.Int} - (OffPtr <types.Int.PtrTo()> [config.PtrSize] dst) + (OffPtr <types.IntPtr> [config.PtrSize] dst) len (Store {types.BytePtr} dst ptr mem))) @@ -83,10 +83,10 @@ (IMake (Load <types.BytePtr> ptr mem) (Load <types.BytePtr> - (OffPtr <types.BytePtr.PtrTo()> [config.PtrSize] ptr) + (OffPtr <types.BytePtrPtr> [config.PtrSize] ptr) mem)) (Store dst (IMake itab data) mem) -> (Store {types.BytePtr} - (OffPtr <types.BytePtr.PtrTo()> [config.PtrSize] dst) + (OffPtr <types.BytePtrPtr> [config.PtrSize] dst) data (Store {types.Uintptr} dst itab mem)) diff --git a/src/cmd/compile/internal/ssa/gen/dec64.rules b/src/cmd/compile/internal/ssa/gen/dec64.rules index 19f9755b40..ea7b95165f 100644 --- a/src/cmd/compile/internal/ssa/gen/dec64.rules +++ b/src/cmd/compile/internal/ssa/gen/dec64.rules @@ -12,23 +12,23 @@ (Load <t> ptr mem) && is64BitInt(t) && !config.BigEndian && t.IsSigned() -> (Int64Make - (Load <types.Int32> (OffPtr <types.Int32.PtrTo()> [4] ptr) mem) + (Load <types.Int32> (OffPtr <types.Int32Ptr> [4] ptr) mem) (Load <types.UInt32> ptr mem)) (Load <t> ptr mem) && is64BitInt(t) && !config.BigEndian && !t.IsSigned() -> (Int64Make - (Load <types.UInt32> (OffPtr <types.UInt32.PtrTo()> [4] ptr) mem) + (Load <types.UInt32> (OffPtr <types.UInt32Ptr> [4] ptr) mem) (Load <types.UInt32> ptr mem)) (Load <t> ptr mem) && is64BitInt(t) && config.BigEndian && t.IsSigned() -> (Int64Make (Load <types.Int32> ptr mem) - (Load <types.UInt32> (OffPtr <types.UInt32.PtrTo()> [4] ptr) mem)) + (Load <types.UInt32> (OffPtr <types.UInt32Ptr> [4] ptr) mem)) (Load <t> ptr mem) && is64BitInt(t) && config.BigEndian && !t.IsSigned() -> (Int64Make (Load <types.UInt32> ptr mem) - (Load <types.UInt32> (OffPtr <types.UInt32.PtrTo()> [4] ptr) mem)) + (Load <types.UInt32> (OffPtr <types.UInt32Ptr> [4] ptr) mem)) (Store {t} dst (Int64Make hi lo) mem) && t.(Type).Size() == 8 && !config.BigEndian -> (Store {hi.Type} diff --git a/src/cmd/compile/internal/ssa/rewriteMIPS.go b/src/cmd/compile/internal/ssa/rewriteMIPS.go index a555c58e58..5e70fc4f73 100644 --- a/src/cmd/compile/internal/ssa/rewriteMIPS.go +++ b/src/cmd/compile/internal/ssa/rewriteMIPS.go @@ -688,7 +688,7 @@ func rewriteValueMIPS_OpAtomicAnd8(v *Value) bool { _ = types // match: (AtomicAnd8 ptr val mem) // cond: !config.BigEndian - // result: (LoweredAtomicAnd (AND <types.UInt32.PtrTo()> (MOVWconst [^3]) ptr) (OR <types.UInt32> (SLL <types.UInt32> (ZeroExt8to32 val) (SLLconst <types.UInt32> [3] (ANDconst <types.UInt32> [3] ptr))) (NORconst [0] <types.UInt32> (SLL <types.UInt32> (MOVWconst [0xff]) (SLLconst <types.UInt32> [3] (ANDconst <types.UInt32> [3] (XORconst <types.UInt32> [3] ptr)))))) mem) + // result: (LoweredAtomicAnd (AND <types.UInt32Ptr> (MOVWconst [^3]) ptr) (OR <types.UInt32> (SLL <types.UInt32> (ZeroExt8to32 val) (SLLconst <types.UInt32> [3] (ANDconst <types.UInt32> [3] ptr))) (NORconst [0] <types.UInt32> (SLL <types.UInt32> (MOVWconst [0xff]) (SLLconst <types.UInt32> [3] (ANDconst <types.UInt32> [3] (XORconst <types.UInt32> [3] ptr)))))) mem) for { ptr := v.Args[0] val := v.Args[1] @@ -697,7 +697,7 @@ func rewriteValueMIPS_OpAtomicAnd8(v *Value) bool { break } v.reset(OpMIPSLoweredAtomicAnd) - v0 := b.NewValue0(v.Pos, OpMIPSAND, types.UInt32.PtrTo()) + v0 := b.NewValue0(v.Pos, OpMIPSAND, types.UInt32Ptr) v1 := b.NewValue0(v.Pos, OpMIPSMOVWconst, types.UInt32) v1.AuxInt = ^3 v0.AddArg(v1) @@ -740,7 +740,7 @@ func rewriteValueMIPS_OpAtomicAnd8(v *Value) bool { } // match: (AtomicAnd8 ptr val mem) // cond: config.BigEndian - // result: (LoweredAtomicAnd (AND <types.UInt32.PtrTo()> (MOVWconst [^3]) ptr) (OR <types.UInt32> (SLL <types.UInt32> (ZeroExt8to32 val) (SLLconst <types.UInt32> [3] (ANDconst <types.UInt32> [3] (XORconst <types.UInt32> [3] ptr)))) (NORconst [0] <types.UInt32> (SLL <types.UInt32> (MOVWconst [0xff]) (SLLconst <types.UInt32> [3] (ANDconst <types.UInt32> [3] (XORconst <types.UInt32> [3] ptr)))))) mem) + // result: (LoweredAtomicAnd (AND <types.UInt32Ptr> (MOVWconst [^3]) ptr) (OR <types.UInt32> (SLL <types.UInt32> (ZeroExt8to32 val) (SLLconst <types.UInt32> [3] (ANDconst <types.UInt32> [3] (XORconst <types.UInt32> [3] ptr)))) (NORconst [0] <types.UInt32> (SLL <types.UInt32> (MOVWconst [0xff]) (SLLconst <types.UInt32> [3] (ANDconst <types.UInt32> [3] (XORconst <types.UInt32> [3] ptr)))))) mem) for { ptr := v.Args[0] val := v.Args[1] @@ -749,7 +749,7 @@ func rewriteValueMIPS_OpAtomicAnd8(v *Value) bool { break } v.reset(OpMIPSLoweredAtomicAnd) - v0 := b.NewValue0(v.Pos, OpMIPSAND, types.UInt32.PtrTo()) + v0 := b.NewValue0(v.Pos, OpMIPSAND, types.UInt32Ptr) v1 := b.NewValue0(v.Pos, OpMIPSMOVWconst, types.UInt32) v1.AuxInt = ^3 v0.AddArg(v1) @@ -862,7 +862,7 @@ func rewriteValueMIPS_OpAtomicOr8(v *Value) bool { _ = types // match: (AtomicOr8 ptr val mem) // cond: !config.BigEndian - // result: (LoweredAtomicOr (AND <types.UInt32.PtrTo()> (MOVWconst [^3]) ptr) (SLL <types.UInt32> (ZeroExt8to32 val) (SLLconst <types.UInt32> [3] (ANDconst <types.UInt32> [3] ptr))) mem) + // result: (LoweredAtomicOr (AND <types.UInt32Ptr> (MOVWconst [^3]) ptr) (SLL <types.UInt32> (ZeroExt8to32 val) (SLLconst <types.UInt32> [3] (ANDconst <types.UInt32> [3] ptr))) mem) for { ptr := v.Args[0] val := v.Args[1] @@ -871,7 +871,7 @@ func rewriteValueMIPS_OpAtomicOr8(v *Value) bool { break } v.reset(OpMIPSLoweredAtomicOr) - v0 := b.NewValue0(v.Pos, OpMIPSAND, types.UInt32.PtrTo()) + v0 := b.NewValue0(v.Pos, OpMIPSAND, types.UInt32Ptr) v1 := b.NewValue0(v.Pos, OpMIPSMOVWconst, types.UInt32) v1.AuxInt = ^3 v0.AddArg(v1) @@ -894,7 +894,7 @@ func rewriteValueMIPS_OpAtomicOr8(v *Value) bool { } // match: (AtomicOr8 ptr val mem) // cond: config.BigEndian - // result: (LoweredAtomicOr (AND <types.UInt32.PtrTo()> (MOVWconst [^3]) ptr) (SLL <types.UInt32> (ZeroExt8to32 val) (SLLconst <types.UInt32> [3] (ANDconst <types.UInt32> [3] (XORconst <types.UInt32> [3] ptr)))) mem) + // result: (LoweredAtomicOr (AND <types.UInt32Ptr> (MOVWconst [^3]) ptr) (SLL <types.UInt32> (ZeroExt8to32 val) (SLLconst <types.UInt32> [3] (ANDconst <types.UInt32> [3] (XORconst <types.UInt32> [3] ptr)))) mem) for { ptr := v.Args[0] val := v.Args[1] @@ -903,7 +903,7 @@ func rewriteValueMIPS_OpAtomicOr8(v *Value) bool { break } v.reset(OpMIPSLoweredAtomicOr) - v0 := b.NewValue0(v.Pos, OpMIPSAND, types.UInt32.PtrTo()) + v0 := b.NewValue0(v.Pos, OpMIPSAND, types.UInt32Ptr) v1 := b.NewValue0(v.Pos, OpMIPSMOVWconst, types.UInt32) v1.AuxInt = ^3 v0.AddArg(v1) diff --git a/src/cmd/compile/internal/ssa/rewritedec.go b/src/cmd/compile/internal/ssa/rewritedec.go index 3946dca922..2782316c7e 100644 --- a/src/cmd/compile/internal/ssa/rewritedec.go +++ b/src/cmd/compile/internal/ssa/rewritedec.go @@ -112,7 +112,7 @@ func rewriteValuedec_OpLoad(v *Value) bool { _ = types // match: (Load <t> ptr mem) // cond: t.IsComplex() && t.Size() == 8 - // result: (ComplexMake (Load <types.Float32> ptr mem) (Load <types.Float32> (OffPtr <types.Float32.PtrTo()> [4] ptr) mem) ) + // result: (ComplexMake (Load <types.Float32> ptr mem) (Load <types.Float32> (OffPtr <types.Float32Ptr> [4] ptr) mem) ) for { t := v.Type ptr := v.Args[0] @@ -126,7 +126,7 @@ func rewriteValuedec_OpLoad(v *Value) bool { v0.AddArg(mem) v.AddArg(v0) v1 := b.NewValue0(v.Pos, OpLoad, types.Float32) - v2 := b.NewValue0(v.Pos, OpOffPtr, types.Float32.PtrTo()) + v2 := b.NewValue0(v.Pos, OpOffPtr, types.Float32Ptr) v2.AuxInt = 4 v2.AddArg(ptr) v1.AddArg(v2) @@ -136,7 +136,7 @@ func rewriteValuedec_OpLoad(v *Value) bool { } // match: (Load <t> ptr mem) // cond: t.IsComplex() && t.Size() == 16 - // result: (ComplexMake (Load <types.Float64> ptr mem) (Load <types.Float64> (OffPtr <types.Float64.PtrTo()> [8] ptr) mem) ) + // result: (ComplexMake (Load <types.Float64> ptr mem) (Load <types.Float64> (OffPtr <types.Float64Ptr> [8] ptr) mem) ) for { t := v.Type ptr := v.Args[0] @@ -150,7 +150,7 @@ func rewriteValuedec_OpLoad(v *Value) bool { v0.AddArg(mem) v.AddArg(v0) v1 := b.NewValue0(v.Pos, OpLoad, types.Float64) - v2 := b.NewValue0(v.Pos, OpOffPtr, types.Float64.PtrTo()) + v2 := b.NewValue0(v.Pos, OpOffPtr, types.Float64Ptr) v2.AuxInt = 8 v2.AddArg(ptr) v1.AddArg(v2) @@ -160,7 +160,7 @@ func rewriteValuedec_OpLoad(v *Value) bool { } // match: (Load <t> ptr mem) // cond: t.IsString() - // result: (StringMake (Load <types.BytePtr> ptr mem) (Load <types.Int> (OffPtr <types.Int.PtrTo()> [config.PtrSize] ptr) mem)) + // result: (StringMake (Load <types.BytePtr> ptr mem) (Load <types.Int> (OffPtr <types.IntPtr> [config.PtrSize] ptr) mem)) for { t := v.Type ptr := v.Args[0] @@ -174,7 +174,7 @@ func rewriteValuedec_OpLoad(v *Value) bool { v0.AddArg(mem) v.AddArg(v0) v1 := b.NewValue0(v.Pos, OpLoad, types.Int) - v2 := b.NewValue0(v.Pos, OpOffPtr, types.Int.PtrTo()) + v2 := b.NewValue0(v.Pos, OpOffPtr, types.IntPtr) v2.AuxInt = config.PtrSize v2.AddArg(ptr) v1.AddArg(v2) @@ -184,7 +184,7 @@ func rewriteValuedec_OpLoad(v *Value) bool { } // match: (Load <t> ptr mem) // cond: t.IsSlice() - // result: (SliceMake (Load <t.ElemType().PtrTo()> ptr mem) (Load <types.Int> (OffPtr <types.Int.PtrTo()> [config.PtrSize] ptr) mem) (Load <types.Int> (OffPtr <types.Int.PtrTo()> [2*config.PtrSize] ptr) mem)) + // result: (SliceMake (Load <t.ElemType().PtrTo()> ptr mem) (Load <types.Int> (OffPtr <types.IntPtr> [config.PtrSize] ptr) mem) (Load <types.Int> (OffPtr <types.IntPtr> [2*config.PtrSize] ptr) mem)) for { t := v.Type ptr := v.Args[0] @@ -198,14 +198,14 @@ func rewriteValuedec_OpLoad(v *Value) bool { v0.AddArg(mem) v.AddArg(v0) v1 := b.NewValue0(v.Pos, OpLoad, types.Int) - v2 := b.NewValue0(v.Pos, OpOffPtr, types.Int.PtrTo()) + v2 := b.NewValue0(v.Pos, OpOffPtr, types.IntPtr) v2.AuxInt = config.PtrSize v2.AddArg(ptr) v1.AddArg(v2) v1.AddArg(mem) v.AddArg(v1) v3 := b.NewValue0(v.Pos, OpLoad, types.Int) - v4 := b.NewValue0(v.Pos, OpOffPtr, types.Int.PtrTo()) + v4 := b.NewValue0(v.Pos, OpOffPtr, types.IntPtr) v4.AuxInt = 2 * config.PtrSize v4.AddArg(ptr) v3.AddArg(v4) @@ -215,7 +215,7 @@ func rewriteValuedec_OpLoad(v *Value) bool { } // match: (Load <t> ptr mem) // cond: t.IsInterface() - // result: (IMake (Load <types.BytePtr> ptr mem) (Load <types.BytePtr> (OffPtr <types.BytePtr.PtrTo()> [config.PtrSize] ptr) mem)) + // result: (IMake (Load <types.BytePtr> ptr mem) (Load <types.BytePtr> (OffPtr <types.BytePtrPtr> [config.PtrSize] ptr) mem)) for { t := v.Type ptr := v.Args[0] @@ -229,7 +229,7 @@ func rewriteValuedec_OpLoad(v *Value) bool { v0.AddArg(mem) v.AddArg(v0) v1 := b.NewValue0(v.Pos, OpLoad, types.BytePtr) - v2 := b.NewValue0(v.Pos, OpOffPtr, types.BytePtr.PtrTo()) + v2 := b.NewValue0(v.Pos, OpOffPtr, types.BytePtrPtr) v2.AuxInt = config.PtrSize v2.AddArg(ptr) v1.AddArg(v2) @@ -299,7 +299,7 @@ func rewriteValuedec_OpStore(v *Value) bool { _ = types // match: (Store {t} dst (ComplexMake real imag) mem) // cond: t.(Type).Size() == 8 - // result: (Store {types.Float32} (OffPtr <types.Float32.PtrTo()> [4] dst) imag (Store {types.Float32} dst real mem)) + // result: (Store {types.Float32} (OffPtr <types.Float32Ptr> [4] dst) imag (Store {types.Float32} dst real mem)) for { t := v.Aux dst := v.Args[0] @@ -315,7 +315,7 @@ func rewriteValuedec_OpStore(v *Value) bool { } v.reset(OpStore) v.Aux = types.Float32 - v0 := b.NewValue0(v.Pos, OpOffPtr, types.Float32.PtrTo()) + v0 := b.NewValue0(v.Pos, OpOffPtr, types.Float32Ptr) v0.AuxInt = 4 v0.AddArg(dst) v.AddArg(v0) @@ -330,7 +330,7 @@ func rewriteValuedec_OpStore(v *Value) bool { } // match: (Store {t} dst (ComplexMake real imag) mem) // cond: t.(Type).Size() == 16 - // result: (Store {types.Float64} (OffPtr <types.Float64.PtrTo()> [8] dst) imag (Store {types.Float64} dst real mem)) + // result: (Store {types.Float64} (OffPtr <types.Float64Ptr> [8] dst) imag (Store {types.Float64} dst real mem)) for { t := v.Aux dst := v.Args[0] @@ -346,7 +346,7 @@ func rewriteValuedec_OpStore(v *Value) bool { } v.reset(OpStore) v.Aux = types.Float64 - v0 := b.NewValue0(v.Pos, OpOffPtr, types.Float64.PtrTo()) + v0 := b.NewValue0(v.Pos, OpOffPtr, types.Float64Ptr) v0.AuxInt = 8 v0.AddArg(dst) v.AddArg(v0) @@ -361,7 +361,7 @@ func rewriteValuedec_OpStore(v *Value) bool { } // match: (Store dst (StringMake ptr len) mem) // cond: - // result: (Store {types.Int} (OffPtr <types.Int.PtrTo()> [config.PtrSize] dst) len (Store {types.BytePtr} dst ptr mem)) + // result: (Store {types.Int} (OffPtr <types.IntPtr> [config.PtrSize] dst) len (Store {types.BytePtr} dst ptr mem)) for { dst := v.Args[0] v_1 := v.Args[1] @@ -373,7 +373,7 @@ func rewriteValuedec_OpStore(v *Value) bool { mem := v.Args[2] v.reset(OpStore) v.Aux = types.Int - v0 := b.NewValue0(v.Pos, OpOffPtr, types.Int.PtrTo()) + v0 := b.NewValue0(v.Pos, OpOffPtr, types.IntPtr) v0.AuxInt = config.PtrSize v0.AddArg(dst) v.AddArg(v0) @@ -388,7 +388,7 @@ func rewriteValuedec_OpStore(v *Value) bool { } // match: (Store dst (SliceMake ptr len cap) mem) // cond: - // result: (Store {types.Int} (OffPtr <types.Int.PtrTo()> [2*config.PtrSize] dst) cap (Store {types.Int} (OffPtr <types.Int.PtrTo()> [config.PtrSize] dst) len (Store {types.BytePtr} dst ptr mem))) + // result: (Store {types.Int} (OffPtr <types.IntPtr> [2*config.PtrSize] dst) cap (Store {types.Int} (OffPtr <types.IntPtr> [config.PtrSize] dst) len (Store {types.BytePtr} dst ptr mem))) for { dst := v.Args[0] v_1 := v.Args[1] @@ -401,14 +401,14 @@ func rewriteValuedec_OpStore(v *Value) bool { mem := v.Args[2] v.reset(OpStore) v.Aux = types.Int - v0 := b.NewValue0(v.Pos, OpOffPtr, types.Int.PtrTo()) + v0 := b.NewValue0(v.Pos, OpOffPtr, types.IntPtr) v0.AuxInt = 2 * config.PtrSize v0.AddArg(dst) v.AddArg(v0) v.AddArg(cap) v1 := b.NewValue0(v.Pos, OpStore, TypeMem) v1.Aux = types.Int - v2 := b.NewValue0(v.Pos, OpOffPtr, types.Int.PtrTo()) + v2 := b.NewValue0(v.Pos, OpOffPtr, types.IntPtr) v2.AuxInt = config.PtrSize v2.AddArg(dst) v1.AddArg(v2) @@ -424,7 +424,7 @@ func rewriteValuedec_OpStore(v *Value) bool { } // match: (Store dst (IMake itab data) mem) // cond: - // result: (Store {types.BytePtr} (OffPtr <types.BytePtr.PtrTo()> [config.PtrSize] dst) data (Store {types.Uintptr} dst itab mem)) + // result: (Store {types.BytePtr} (OffPtr <types.BytePtrPtr> [config.PtrSize] dst) data (Store {types.Uintptr} dst itab mem)) for { dst := v.Args[0] v_1 := v.Args[1] @@ -436,7 +436,7 @@ func rewriteValuedec_OpStore(v *Value) bool { mem := v.Args[2] v.reset(OpStore) v.Aux = types.BytePtr - v0 := b.NewValue0(v.Pos, OpOffPtr, types.BytePtr.PtrTo()) + v0 := b.NewValue0(v.Pos, OpOffPtr, types.BytePtrPtr) v0.AuxInt = config.PtrSize v0.AddArg(dst) v.AddArg(v0) diff --git a/src/cmd/compile/internal/ssa/rewritedec64.go b/src/cmd/compile/internal/ssa/rewritedec64.go index 610018c9b6..9e7802d431 100644 --- a/src/cmd/compile/internal/ssa/rewritedec64.go +++ b/src/cmd/compile/internal/ssa/rewritedec64.go @@ -847,7 +847,7 @@ func rewriteValuedec64_OpLoad(v *Value) bool { _ = types // match: (Load <t> ptr mem) // cond: is64BitInt(t) && !config.BigEndian && t.IsSigned() - // result: (Int64Make (Load <types.Int32> (OffPtr <types.Int32.PtrTo()> [4] ptr) mem) (Load <types.UInt32> ptr mem)) + // result: (Int64Make (Load <types.Int32> (OffPtr <types.Int32Ptr> [4] ptr) mem) (Load <types.UInt32> ptr mem)) for { t := v.Type ptr := v.Args[0] @@ -857,7 +857,7 @@ func rewriteValuedec64_OpLoad(v *Value) bool { } v.reset(OpInt64Make) v0 := b.NewValue0(v.Pos, OpLoad, types.Int32) - v1 := b.NewValue0(v.Pos, OpOffPtr, types.Int32.PtrTo()) + v1 := b.NewValue0(v.Pos, OpOffPtr, types.Int32Ptr) v1.AuxInt = 4 v1.AddArg(ptr) v0.AddArg(v1) @@ -871,7 +871,7 @@ func rewriteValuedec64_OpLoad(v *Value) bool { } // match: (Load <t> ptr mem) // cond: is64BitInt(t) && !config.BigEndian && !t.IsSigned() - // result: (Int64Make (Load <types.UInt32> (OffPtr <types.UInt32.PtrTo()> [4] ptr) mem) (Load <types.UInt32> ptr mem)) + // result: (Int64Make (Load <types.UInt32> (OffPtr <types.UInt32Ptr> [4] ptr) mem) (Load <types.UInt32> ptr mem)) for { t := v.Type ptr := v.Args[0] @@ -881,7 +881,7 @@ func rewriteValuedec64_OpLoad(v *Value) bool { } v.reset(OpInt64Make) v0 := b.NewValue0(v.Pos, OpLoad, types.UInt32) - v1 := b.NewValue0(v.Pos, OpOffPtr, types.UInt32.PtrTo()) + v1 := b.NewValue0(v.Pos, OpOffPtr, types.UInt32Ptr) v1.AuxInt = 4 v1.AddArg(ptr) v0.AddArg(v1) @@ -895,7 +895,7 @@ func rewriteValuedec64_OpLoad(v *Value) bool { } // match: (Load <t> ptr mem) // cond: is64BitInt(t) && config.BigEndian && t.IsSigned() - // result: (Int64Make (Load <types.Int32> ptr mem) (Load <types.UInt32> (OffPtr <types.UInt32.PtrTo()> [4] ptr) mem)) + // result: (Int64Make (Load <types.Int32> ptr mem) (Load <types.UInt32> (OffPtr <types.UInt32Ptr> [4] ptr) mem)) for { t := v.Type ptr := v.Args[0] @@ -909,7 +909,7 @@ func rewriteValuedec64_OpLoad(v *Value) bool { v0.AddArg(mem) v.AddArg(v0) v1 := b.NewValue0(v.Pos, OpLoad, types.UInt32) - v2 := b.NewValue0(v.Pos, OpOffPtr, types.UInt32.PtrTo()) + v2 := b.NewValue0(v.Pos, OpOffPtr, types.UInt32Ptr) v2.AuxInt = 4 v2.AddArg(ptr) v1.AddArg(v2) @@ -919,7 +919,7 @@ func rewriteValuedec64_OpLoad(v *Value) bool { } // match: (Load <t> ptr mem) // cond: is64BitInt(t) && config.BigEndian && !t.IsSigned() - // result: (Int64Make (Load <types.UInt32> ptr mem) (Load <types.UInt32> (OffPtr <types.UInt32.PtrTo()> [4] ptr) mem)) + // result: (Int64Make (Load <types.UInt32> ptr mem) (Load <types.UInt32> (OffPtr <types.UInt32Ptr> [4] ptr) mem)) for { t := v.Type ptr := v.Args[0] @@ -933,7 +933,7 @@ func rewriteValuedec64_OpLoad(v *Value) bool { v0.AddArg(mem) v.AddArg(v0) v1 := b.NewValue0(v.Pos, OpLoad, types.UInt32) - v2 := b.NewValue0(v.Pos, OpOffPtr, types.UInt32.PtrTo()) + v2 := b.NewValue0(v.Pos, OpOffPtr, types.UInt32Ptr) v2.AuxInt = 4 v2.AddArg(ptr) v1.AddArg(v2) diff --git a/src/cmd/compile/internal/ssa/writebarrier.go b/src/cmd/compile/internal/ssa/writebarrier.go index 850a4b886d..a8eac9f5eb 100644 --- a/src/cmd/compile/internal/ssa/writebarrier.go +++ b/src/cmd/compile/internal/ssa/writebarrier.go @@ -94,7 +94,7 @@ func writebarrier(f *Func) { sp = f.Entry.NewValue0(initpos, OpSP, f.Config.Types.Uintptr) } wbsym := &ExternSymbol{Typ: f.Config.Types.Bool, Sym: f.fe.Syslook("writeBarrier")} - wbaddr = f.Entry.NewValue1A(initpos, OpAddr, f.Config.Types.UInt32.PtrTo(), wbsym, sb) + wbaddr = f.Entry.NewValue1A(initpos, OpAddr, f.Config.Types.UInt32Ptr, wbsym, sb) writebarrierptr = f.fe.Syslook("writebarrierptr") typedmemmove = f.fe.Syslook("typedmemmove") typedmemclr = f.fe.Syslook("typedmemclr") |