Commit 872db799 authored by Josh Bleecher Snyder's avatar Josh Bleecher Snyder

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: default avatarMatthew Dempsky <mdempsky@google.com>
parent aea3aff6
This diff is collapsed.
......@@ -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 {
......
......@@ -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 }
......
......@@ -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]
......
......@@ -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))
......@@ -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}
......
......@@ -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)
......
......@@ -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)
......
......@@ -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)
......
......@@ -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")
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment