mirror of
https://github.com/apple/swift.git
synced 2025-12-14 20:36:38 +01:00
Disable large types irgen pass
This commit is contained in:
@@ -222,8 +222,6 @@ PASS(ReleaseHoisting, "release-hoisting",
|
|||||||
"SIL release Hoisting")
|
"SIL release Hoisting")
|
||||||
PASS(LateReleaseHoisting, "late-release-hoisting",
|
PASS(LateReleaseHoisting, "late-release-hoisting",
|
||||||
"Late SIL release Hoisting Preserving Epilogues")
|
"Late SIL release Hoisting Preserving Epilogues")
|
||||||
IRGEN_PASS(LoadableByAddress, "loadable-address",
|
|
||||||
"SIL Loadable type by-address lowering.")
|
|
||||||
PASS(RemovePins, "remove-pins",
|
PASS(RemovePins, "remove-pins",
|
||||||
"Remove SIL pin/unpin pairs")
|
"Remove SIL pin/unpin pairs")
|
||||||
PASS(SideEffectsDumper, "side-effects-dump",
|
PASS(SideEffectsDumper, "side-effects-dump",
|
||||||
|
|||||||
@@ -437,7 +437,7 @@ static void addIRGenPreparePipeline(SILPassPipelinePlan &P) {
|
|||||||
// Hoist generic alloc_stack instructions to the entry block to enable better
|
// Hoist generic alloc_stack instructions to the entry block to enable better
|
||||||
// llvm-ir generation for dynamic alloca instructions.
|
// llvm-ir generation for dynamic alloca instructions.
|
||||||
P.addAllocStackHoisting();
|
P.addAllocStackHoisting();
|
||||||
P.addLoadableByAddress();
|
//P.addLoadableByAddress();
|
||||||
}
|
}
|
||||||
|
|
||||||
SILPassPipelinePlan SILPassPipelinePlan::getIRGenPreparePassPipeline() {
|
SILPassPipelinePlan SILPassPipelinePlan::getIRGenPreparePassPipeline() {
|
||||||
|
|||||||
@@ -20,10 +20,9 @@ public func g(_ s : String?)
|
|||||||
{
|
{
|
||||||
// CHECK2: define {{.*}}@_T04main1gySSSgF
|
// CHECK2: define {{.*}}@_T04main1gySSSgF
|
||||||
// The shadow copy store should not have a location.
|
// The shadow copy store should not have a location.
|
||||||
// CHECK2-64: getelementptr inbounds {{.*}} %s.debug, {{.*}}, !dbg ![[DBG0:.*]]
|
// CHECK2: getelementptr inbounds {{.*}} %s.debug, {{.*}}, !dbg ![[DBG0:.*]]
|
||||||
// CHECK2: ![[G:.*]] = distinct !DISubprogram(name: "g",
|
// CHECK2: ![[G:.*]] = distinct !DISubprogram(name: "g",
|
||||||
// CHECK2-63: ![[DBG0]] = !DILocation(line: 0, scope: ![[G]])
|
// CHECK2: ![[DBG0]] = !DILocation(line: 0, scope: ![[G]])
|
||||||
// CHECK2-32: ![[DBG0]] = !DILocation(line: 0, scope: !
|
|
||||||
guard let val = s else { return }
|
guard let val = s else { return }
|
||||||
use(val)
|
use(val)
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,113 +0,0 @@
|
|||||||
// RUN: %target-swift-frontend -assume-parsing-unqualified-ownership-sil %s -emit-ir | %FileCheck %s
|
|
||||||
|
|
||||||
public struct BigStruct {
|
|
||||||
var i0 : Int32 = 0
|
|
||||||
var i1 : Int32 = 1
|
|
||||||
var i2 : Int32 = 2
|
|
||||||
var i3 : Int32 = 3
|
|
||||||
var i4 : Int32 = 4
|
|
||||||
var i5 : Int32 = 5
|
|
||||||
var i6 : Int32 = 6
|
|
||||||
var i7 : Int32 = 7
|
|
||||||
var i8 : Int32 = 8
|
|
||||||
}
|
|
||||||
|
|
||||||
func takeClosure(execute block: () -> Void) {
|
|
||||||
}
|
|
||||||
|
|
||||||
class OptionalInoutFuncType {
|
|
||||||
private var lp : BigStruct?
|
|
||||||
private var _handler : ((BigStruct?, Error?) -> ())?
|
|
||||||
|
|
||||||
func execute(_ error: Error?) {
|
|
||||||
var p : BigStruct?
|
|
||||||
var handler: ((BigStruct?, Error?) -> ())?
|
|
||||||
|
|
||||||
takeClosure {
|
|
||||||
p = self.lp
|
|
||||||
handler = self._handler
|
|
||||||
self._handler = nil
|
|
||||||
}
|
|
||||||
|
|
||||||
handler?(p, error)
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
// CHECK-LABEL: define{{( protected)?}} internal swiftcc void @_T022big_types_corner_cases21OptionalInoutFuncTypeC7executeys5Error_pSgFyycfU_(%T22big_types_corner_cases9BigStructVSg* nocapture dereferenceable({{.*}}), %T22big_types_corner_cases21OptionalInoutFuncTypeC*, %T22big_types_corner_cases9BigStructVSgs5Error_pSgIxcx_Sg* nocapture dereferenceable({{.*}})
|
|
||||||
// CHECK: call void @_T0SqWy
|
|
||||||
// CHECK: call void @_T0SqWe
|
|
||||||
// CHECK: ret void
|
|
||||||
|
|
||||||
public func f1_returns_BigType(_ x: BigStruct) -> BigStruct {
|
|
||||||
return x
|
|
||||||
}
|
|
||||||
|
|
||||||
public func f2_returns_f1() -> (_ x: BigStruct) -> BigStruct {
|
|
||||||
return f1_returns_BigType
|
|
||||||
}
|
|
||||||
|
|
||||||
public func f3_uses_f2() {
|
|
||||||
let x = BigStruct()
|
|
||||||
let useOfF2 = f2_returns_f1()
|
|
||||||
let _ = useOfF2(x)
|
|
||||||
}
|
|
||||||
|
|
||||||
// CHECK-LABEL: define{{( protected)?}} swiftcc void @_T022big_types_corner_cases10f3_uses_f2yyF()
|
|
||||||
// CHECK: call swiftcc void @_T022big_types_corner_cases9BigStructVACycfC(%T22big_types_corner_cases9BigStructV* noalias nocapture sret
|
|
||||||
// CHECK: call swiftcc { i8*, %swift.refcounted* } @_T022big_types_corner_cases13f2_returns_f1AA9BigStructVADcyF()
|
|
||||||
// CHECK: call swiftcc void %16(%T22big_types_corner_cases9BigStructV* noalias nocapture sret %call.aggresult1, %T22big_types_corner_cases9BigStructV* noalias nocapture dereferenceable
|
|
||||||
// CHECK: ret void
|
|
||||||
|
|
||||||
public func f4_tuple_use_of_f2() {
|
|
||||||
let x = BigStruct()
|
|
||||||
let tupleWithFunc = (f2_returns_f1(), x)
|
|
||||||
let useOfF2 = tupleWithFunc.0
|
|
||||||
let _ = useOfF2(x)
|
|
||||||
}
|
|
||||||
|
|
||||||
// CHECK-LABEL: define{{( protected)?}} swiftcc void @_T022big_types_corner_cases18f4_tuple_use_of_f2yyF()
|
|
||||||
// CHECK: [[TUPLE:%.*]] = call swiftcc { i8*, %swift.refcounted* } @_T022big_types_corner_cases13f2_returns_f1AA9BigStructVADcyF()
|
|
||||||
// CHECK: [[TUPLE_EXTRACT:%.*]] = extractvalue { i8*, %swift.refcounted* } [[TUPLE]], 0
|
|
||||||
// CHECK: [[CAST_EXTRACT:%.*]] = bitcast i8* [[TUPLE_EXTRACT]] to void (%T22big_types_corner_cases9BigStructV*, %T22big_types_corner_cases9BigStructV*, %swift.refcounted*)*
|
|
||||||
// CHECK: call swiftcc void [[CAST_EXTRACT]](%T22big_types_corner_cases9BigStructV* noalias nocapture sret %call.aggresult1, %T22big_types_corner_cases9BigStructV* noalias nocapture dereferenceable
|
|
||||||
// CHECK: ret void
|
|
||||||
|
|
||||||
public class BigClass {
|
|
||||||
public init() {
|
|
||||||
}
|
|
||||||
|
|
||||||
public var optVar: ((BigStruct)-> Void)? = nil
|
|
||||||
|
|
||||||
func useBigStruct(bigStruct: BigStruct) {
|
|
||||||
optVar!(bigStruct)
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
// CHECK-LABEL define{{( protected)?}} hidden swiftcc void @_T022big_types_corner_cases8BigClassC03useE6StructyAA0eH0V0aH0_tF(%T22big_types_corner_cases9BigStructV* noalias nocapture dereferenceable({{.*}}), %T22big_types_corner_cases8BigClassC* swiftself) #0 {
|
|
||||||
// CHECK: getelementptr inbounds %T22big_types_corner_cases8BigClassC, %T22big_types_corner_cases8BigClassC*
|
|
||||||
// CHECK: call void @_T0SqWy
|
|
||||||
// CHECK: [[BITCAST:%.*]] = bitcast i8* {{.*}} to void (%T22big_types_corner_cases9BigStructV*, %swift.refcounted*)*
|
|
||||||
// CHECK: call swiftcc void [[BITCAST]](%T22big_types_corner_cases9BigStructV* noalias nocapture dereferenceable({{.*}}) %0, %swift.refcounted* swiftself
|
|
||||||
// CHECK: ret void
|
|
||||||
|
|
||||||
public struct MyStruct {
|
|
||||||
public let a: Int
|
|
||||||
public let b: String?
|
|
||||||
}
|
|
||||||
|
|
||||||
typealias UploadFunction = ((MyStruct, Int?) -> Void) -> Void
|
|
||||||
func takesUploader(_ u: UploadFunction) { }
|
|
||||||
|
|
||||||
class Foo {
|
|
||||||
func blam() {
|
|
||||||
takesUploader(self.myMethod) // crash compiling this
|
|
||||||
}
|
|
||||||
|
|
||||||
func myMethod(_ callback: (MyStruct, Int) -> Void) -> Void { }
|
|
||||||
}
|
|
||||||
|
|
||||||
// CHECK-LABEL: define{{( protected)?}} linkonce_odr hidden swiftcc { i8*, %swift.refcounted* } @_T022big_types_corner_cases3FooC8myMethodyyAA8MyStructV_SitcFTc(%T22big_types_corner_cases3FooC*)
|
|
||||||
// CHECK: getelementptr inbounds %T22big_types_corner_cases3FooC, %T22big_types_corner_cases3FooC*
|
|
||||||
// CHECK: getelementptr inbounds void (i8*, %swift.refcounted*, %T22big_types_corner_cases3FooC*)*, void (i8*, %swift.refcounted*, %T22big_types_corner_cases3FooC*)**
|
|
||||||
// CHECK: call noalias %swift.refcounted* @swift_rt_swift_allocObject(%swift.type* getelementptr inbounds (%swift.full_boxmetadata, %swift.full_boxmetadata*
|
|
||||||
// CHECK: ret { i8*, %swift.refcounted* }
|
|
||||||
@@ -304,7 +304,7 @@ entry(%b : $@convention(block) (CChar) -> CChar, %c : $CChar):
|
|||||||
}
|
}
|
||||||
|
|
||||||
// CHECK-x86_64-LABEL: define{{( protected)?}} swiftcc void @testBitfieldInBlock
|
// CHECK-x86_64-LABEL: define{{( protected)?}} swiftcc void @testBitfieldInBlock
|
||||||
// CHECK-x86_64: call void {{%.*}}(%TSC11BitfieldOneV* noalias nocapture sret {{%.*}}, %objc_block* {{%.*}}, %struct.BitfieldOne* {{%.*}})
|
// CHECK-x86_64: call void {{%.*}}(%TSC11BitfieldOneV* noalias nocapture sret {{%.*}}, %objc_block* {{%.*}}, %TSC11BitfieldOneV* byval align 8 {{%.*}})
|
||||||
sil @testBitfieldInBlock : $@convention(thin) (@owned @convention(block) (BitfieldOne) -> BitfieldOne, BitfieldOne) -> BitfieldOne {
|
sil @testBitfieldInBlock : $@convention(thin) (@owned @convention(block) (BitfieldOne) -> BitfieldOne, BitfieldOne) -> BitfieldOne {
|
||||||
entry(%b : $@convention(block) (BitfieldOne) -> BitfieldOne, %x : $BitfieldOne):
|
entry(%b : $@convention(block) (BitfieldOne) -> BitfieldOne, %x : $BitfieldOne):
|
||||||
%r = apply %b(%x) : $@convention(block) (BitfieldOne) -> BitfieldOne
|
%r = apply %b(%x) : $@convention(block) (BitfieldOne) -> BitfieldOne
|
||||||
|
|||||||
@@ -27,18 +27,15 @@ bb0(%0 : $Builtin.Int32):
|
|||||||
return %2 : $()
|
return %2 : $()
|
||||||
}
|
}
|
||||||
|
|
||||||
// CHECK-LABEL: define{{( protected)?}} swiftcc void @non_trivial(%T019copy_value_destroy_B03FooV* noalias nocapture dereferenceable(36))
|
// CHECK: define{{( protected)?}} swiftcc void @non_trivial(
|
||||||
// CHECK: call void @llvm.memcpy
|
// CHECK: [[GEP1:%.*]] = getelementptr inbounds %T019copy_value_destroy_B03FooV, %T019copy_value_destroy_B03FooV* %0, i32 0, i32 2
|
||||||
// CHECK: [[GEP1:%.*]] = getelementptr inbounds %T019copy_value_destroy_B03FooV, %T019copy_value_destroy_B03FooV* %1, i32 0, i32 2
|
|
||||||
// CHECK: [[VAL1:%.*]] = load %swift.refcounted*, %swift.refcounted** [[GEP1]], align 8
|
// CHECK: [[VAL1:%.*]] = load %swift.refcounted*, %swift.refcounted** [[GEP1]], align 8
|
||||||
// CHECK: [[GEP2:%.*]] = getelementptr inbounds %T019copy_value_destroy_B03FooV, %T019copy_value_destroy_B03FooV* %1, i32 0, i32 5
|
// CHECK: [[GEP2:%.*]] = getelementptr inbounds %T019copy_value_destroy_B03FooV, %T019copy_value_destroy_B03FooV* %0, i32 0, i32 5
|
||||||
// CHECK: [[VAL2:%.*]] = load %swift.refcounted*, %swift.refcounted** [[GEP2]], align 8
|
// CHECK: [[VAL2:%.*]] = load %swift.refcounted*, %swift.refcounted** [[GEP2]], align 8
|
||||||
// CHECK: call void @swift_rt_swift_retain(%swift.refcounted* [[VAL1]])
|
// CHECK: call void @swift_rt_swift_retain(%swift.refcounted* [[VAL1]])
|
||||||
// CHECK: call void @swift_rt_swift_retain(%swift.refcounted* [[VAL2]])
|
// CHECK: call void @swift_rt_swift_retain(%swift.refcounted* [[VAL2]])
|
||||||
// CHECK: call void @swift_rt_swift_release(%swift.refcounted* [[VAL1]])
|
// CHECK: call void @swift_rt_swift_release(%swift.refcounted* [[VAL1]])
|
||||||
// CHECK: call void @swift_rt_swift_release(%swift.refcounted* [[VAL2]])
|
// CHECK: call void @swift_rt_swift_release(%swift.refcounted* [[VAL2]])
|
||||||
// CHECK: ret void
|
|
||||||
// CHECK-LABEL: }
|
|
||||||
sil @non_trivial : $@convention(thin) (Foo) -> () {
|
sil @non_trivial : $@convention(thin) (Foo) -> () {
|
||||||
bb0(%0 : $Foo):
|
bb0(%0 : $Foo):
|
||||||
%1 = copy_value %0 : $Foo
|
%1 = copy_value %0 : $Foo
|
||||||
|
|||||||
@@ -221,17 +221,26 @@ sil @singleton_switch_arg : $(Singleton) -> () {
|
|||||||
// CHECK-32: entry:
|
// CHECK-32: entry:
|
||||||
entry(%u : $Singleton):
|
entry(%u : $Singleton):
|
||||||
// CHECK-32: [[CAST:%.*]] = bitcast %T4enum9SingletonO* %0 to <{ i64, i64 }>*
|
// CHECK-32: [[CAST:%.*]] = bitcast %T4enum9SingletonO* %0 to <{ i64, i64 }>*
|
||||||
// CHECK-32: call void @llvm.memcpy.p0i8.p0i8.i32
|
// CHECK-32: [[GEP1:%.*]] = getelementptr inbounds <{ i64, i64 }>, <{ i64, i64 }>* [[CAST]], i32 0, i32 0
|
||||||
|
// CHECK-32: [[ELT1:%.*]] = load i64, i64* [[GEP1]]
|
||||||
|
// CHECK-32: [[GEP2:%.*]] = getelementptr inbounds <{ i64, i64 }>, <{ i64, i64 }>* [[CAST]], i32 0, i32 1
|
||||||
|
// CHECK-32: [[ELT2:%.*]] = load i64, i64* [[GEP2]]
|
||||||
// CHECK-64: br label %[[PREDEST:[0-9]+]]
|
// CHECK-64: br label %[[PREDEST:[0-9]+]]
|
||||||
|
// CHECK-32: br label %[[PREDEST:[0-9]+]]
|
||||||
switch_enum %u : $Singleton, case #Singleton.value!enumelt.1: dest
|
switch_enum %u : $Singleton, case #Singleton.value!enumelt.1: dest
|
||||||
|
|
||||||
// CHECK-64: ; <label>:[[PREDEST]]
|
// CHECK-64: ; <label>:[[PREDEST]]
|
||||||
// CHECK-64: br label %[[DEST:[0-9]+]]
|
// CHECK-64: br label %[[DEST:[0-9]+]]
|
||||||
// CHECK-64: ; <label>:[[DEST]]
|
// CHECK-64: ; <label>:[[DEST]]
|
||||||
|
// CHECK-32: ; <label>:[[PREDEST]]
|
||||||
|
// CHECK-32: br label %[[DEST:[0-9]+]]
|
||||||
|
// CHECK-32: ; <label>:[[DEST]]
|
||||||
dest(%u2 : $(Builtin.Int64, Builtin.Int64)):
|
dest(%u2 : $(Builtin.Int64, Builtin.Int64)):
|
||||||
// CHECK-64: {{%.*}} = phi i64 [ %0, %[[PREDEST]] ]
|
// CHECK-64: {{%.*}} = phi i64 [ %0, %[[PREDEST]] ]
|
||||||
// CHECK-64: {{%.*}} = phi i64 [ %1, %[[PREDEST]] ]
|
// CHECK-64: {{%.*}} = phi i64 [ %1, %[[PREDEST]] ]
|
||||||
// CHECK-64: ret void
|
// CHECK-64: ret void
|
||||||
|
// CHECK-32: {{%.*}} = phi i64 [ [[ELT1]], %[[PREDEST]] ]
|
||||||
|
// CHECK-32: {{%.*}} = phi i64 [ [[ELT2]], %[[PREDEST]] ]
|
||||||
// CHECK-32: ret void
|
// CHECK-32: ret void
|
||||||
%x = tuple ()
|
%x = tuple ()
|
||||||
return %x : $()
|
return %x : $()
|
||||||
@@ -745,7 +754,11 @@ entry(%u : $AggregateSinglePayload2):
|
|||||||
// CHECK-32: [[LOAD4:%.*]] = load i32, i32* {{.*}}
|
// CHECK-32: [[LOAD4:%.*]] = load i32, i32* {{.*}}
|
||||||
switch_enum %u : $AggregateSinglePayload2, case #AggregateSinglePayload2.x!enumelt.1: x_dest, default end
|
switch_enum %u : $AggregateSinglePayload2, case #AggregateSinglePayload2.x!enumelt.1: x_dest, default end
|
||||||
|
|
||||||
// CHECK-32: call void @llvm.memcpy.p0i8.p0i8.i32
|
// CHECK-32: [[TRUNC:%.*]] = trunc [[WORD]] [[LOAD1]] to i21
|
||||||
|
// CHECK-32: phi i21 [ [[TRUNC]]
|
||||||
|
// CHECK-32: phi [[WORD]] [ [[LOAD2]]
|
||||||
|
// CHECK-32: phi [[WORD]] [ [[LOAD3]]
|
||||||
|
// CHECK-32: phi [[WORD]] [ [[LOAD4]]
|
||||||
|
|
||||||
// CHECK-64: [[TRUNC:%.*]] = trunc [[WORD]] %0 to i21
|
// CHECK-64: [[TRUNC:%.*]] = trunc [[WORD]] %0 to i21
|
||||||
// CHECK-64: phi i21 [ [[TRUNC]]
|
// CHECK-64: phi i21 [ [[TRUNC]]
|
||||||
|
|||||||
@@ -12,9 +12,9 @@ struct HugeAlignment {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// TODO: could be the context param
|
// TODO: could be the context param
|
||||||
// CHECK-LABEL-64: define{{( protected)?}} swiftcc void @huge_method(%T17indirect_argument4HugeV* noalias nocapture dereferenceable({{.*}}))
|
// CHECK-LABEL: define{{( protected)?}} swiftcc void @huge_method(%T17indirect_argument4HugeV* noalias nocapture dereferenceable({{.*}}))
|
||||||
// CHECK-LABEL-32: define{{( protected)?}} swiftcc void @huge_method(%T17indirect_argument4HugeV* noalias nocapture swiftself dereferenceable({{.*}}))
|
// CHECK: [[TMP:%.*]] = alloca
|
||||||
// CHECK: call swiftcc void @huge_method(%T17indirect_argument4HugeV* noalias nocapture swiftself dereferenceable({{.*}})
|
// CHECK: call swiftcc void @huge_method(%T17indirect_argument4HugeV* noalias nocapture dereferenceable({{.*}}) [[TMP]])
|
||||||
sil @huge_method : $@convention(method) Huge -> () {
|
sil @huge_method : $@convention(method) Huge -> () {
|
||||||
entry(%x : $Huge):
|
entry(%x : $Huge):
|
||||||
%f = function_ref @huge_method : $@convention(method) Huge -> ()
|
%f = function_ref @huge_method : $@convention(method) Huge -> ()
|
||||||
@@ -23,7 +23,8 @@ entry(%x : $Huge):
|
|||||||
}
|
}
|
||||||
|
|
||||||
// CHECK-LABEL: define{{( protected)?}} swiftcc void @huge_param(%T17indirect_argument4HugeV* noalias nocapture dereferenceable({{.*}}))
|
// CHECK-LABEL: define{{( protected)?}} swiftcc void @huge_param(%T17indirect_argument4HugeV* noalias nocapture dereferenceable({{.*}}))
|
||||||
// CHECK: call swiftcc void @huge_param(%T17indirect_argument4HugeV* noalias nocapture dereferenceable({{.*}}) %0)
|
// CHECK: [[TMP:%.*]] = alloca
|
||||||
|
// CHECK: call swiftcc void @huge_param(%T17indirect_argument4HugeV* noalias nocapture dereferenceable({{.*}}) [[TMP]])
|
||||||
sil @huge_param : $@convention(thin) Huge -> () {
|
sil @huge_param : $@convention(thin) Huge -> () {
|
||||||
entry(%x : $Huge):
|
entry(%x : $Huge):
|
||||||
%f = function_ref @huge_param : $@convention(thin) Huge -> ()
|
%f = function_ref @huge_param : $@convention(thin) Huge -> ()
|
||||||
@@ -32,7 +33,8 @@ entry(%x : $Huge):
|
|||||||
}
|
}
|
||||||
|
|
||||||
// CHECK-LABEL: define{{( protected)?}} swiftcc void @huge_alignment_param(%T17indirect_argument13HugeAlignmentV* noalias nocapture dereferenceable({{.*}}))
|
// CHECK-LABEL: define{{( protected)?}} swiftcc void @huge_alignment_param(%T17indirect_argument13HugeAlignmentV* noalias nocapture dereferenceable({{.*}}))
|
||||||
// CHECK: call swiftcc void @huge_alignment_param(%T17indirect_argument13HugeAlignmentV* noalias nocapture dereferenceable({{.*}}) %0)
|
// CHECK: [[TMP:%.*]] = alloca
|
||||||
|
// CHECK: call swiftcc void @huge_alignment_param(%T17indirect_argument13HugeAlignmentV* noalias nocapture dereferenceable({{.*}}) [[TMP]])
|
||||||
sil @huge_alignment_param : $@convention(thin) HugeAlignment -> () {
|
sil @huge_alignment_param : $@convention(thin) HugeAlignment -> () {
|
||||||
entry(%x : $HugeAlignment):
|
entry(%x : $HugeAlignment):
|
||||||
%f = function_ref @huge_alignment_param : $@convention(thin) HugeAlignment -> ()
|
%f = function_ref @huge_alignment_param : $@convention(thin) HugeAlignment -> ()
|
||||||
@@ -41,8 +43,9 @@ entry(%x : $HugeAlignment):
|
|||||||
}
|
}
|
||||||
|
|
||||||
// CHECK-LABEL: define{{( protected)?}} swiftcc void @huge_param_and_return(%T17indirect_argument4HugeV* noalias nocapture sret, %T17indirect_argument4HugeV* noalias nocapture dereferenceable({{.*}}))
|
// CHECK-LABEL: define{{( protected)?}} swiftcc void @huge_param_and_return(%T17indirect_argument4HugeV* noalias nocapture sret, %T17indirect_argument4HugeV* noalias nocapture dereferenceable({{.*}}))
|
||||||
// CHECK: [[TMP:%.*]] = alloca
|
// CHECK: [[TMP_ARG:%.*]] = alloca
|
||||||
// CHECK: call swiftcc void @huge_param_and_return(%T17indirect_argument4HugeV* noalias nocapture sret [[TMP]], %T17indirect_argument4HugeV* noalias nocapture dereferenceable({{.*}}) %1)
|
// CHECK: [[TMP_RET:%.*]] = alloca
|
||||||
|
// CHECK: call swiftcc void @huge_param_and_return(%T17indirect_argument4HugeV* noalias nocapture sret [[TMP_RET]], %T17indirect_argument4HugeV* noalias nocapture dereferenceable({{.*}}) [[TMP_ARG]])
|
||||||
sil @huge_param_and_return : $@convention(thin) Huge -> Huge {
|
sil @huge_param_and_return : $@convention(thin) Huge -> Huge {
|
||||||
entry(%x : $Huge):
|
entry(%x : $Huge):
|
||||||
%f = function_ref @huge_param_and_return : $@convention(thin) Huge -> Huge
|
%f = function_ref @huge_param_and_return : $@convention(thin) Huge -> Huge
|
||||||
@@ -51,7 +54,8 @@ entry(%x : $Huge):
|
|||||||
}
|
}
|
||||||
|
|
||||||
// CHECK-LABEL: define{{( protected)?}} swiftcc void @huge_param_and_indirect_return(%T17indirect_argument4HugeV* noalias nocapture sret, %T17indirect_argument4HugeV* noalias nocapture dereferenceable({{.*}}))
|
// CHECK-LABEL: define{{( protected)?}} swiftcc void @huge_param_and_indirect_return(%T17indirect_argument4HugeV* noalias nocapture sret, %T17indirect_argument4HugeV* noalias nocapture dereferenceable({{.*}}))
|
||||||
// CHECK: call swiftcc void @huge_param_and_indirect_return(%T17indirect_argument4HugeV* noalias nocapture sret %0, %T17indirect_argument4HugeV* noalias nocapture dereferenceable({{.*}}) %1)
|
// CHECK: [[TMP_ARG:%.*]] = alloca
|
||||||
|
// CHECK: call swiftcc void @huge_param_and_indirect_return(%T17indirect_argument4HugeV* noalias nocapture sret %0, %T17indirect_argument4HugeV* noalias nocapture dereferenceable({{.*}}) [[TMP_ARG]])
|
||||||
sil @huge_param_and_indirect_return : $@convention(thin) (Huge) -> @out Huge {
|
sil @huge_param_and_indirect_return : $@convention(thin) (Huge) -> @out Huge {
|
||||||
entry(%o : $*Huge, %x : $Huge):
|
entry(%o : $*Huge, %x : $Huge):
|
||||||
%f = function_ref @huge_param_and_indirect_return : $@convention(thin) (Huge) -> @out Huge
|
%f = function_ref @huge_param_and_indirect_return : $@convention(thin) (Huge) -> @out Huge
|
||||||
@@ -60,12 +64,10 @@ entry(%o : $*Huge, %x : $Huge):
|
|||||||
}
|
}
|
||||||
|
|
||||||
// CHECK-LABEL: define{{( protected)?}} swiftcc void @huge_partial_application(%T17indirect_argument4HugeV* noalias nocapture dereferenceable({{.*}}), %T17indirect_argument4HugeV* noalias nocapture dereferenceable({{.*}}))
|
// CHECK-LABEL: define{{( protected)?}} swiftcc void @huge_partial_application(%T17indirect_argument4HugeV* noalias nocapture dereferenceable({{.*}}), %T17indirect_argument4HugeV* noalias nocapture dereferenceable({{.*}}))
|
||||||
// CHECK-32: [[CLOSURE:%.*]] = call noalias %swift.refcounted* @swift_rt_swift_allocObject
|
// CHECK: [[TMP_ARG:%.*]] = alloca
|
||||||
// CHECK-64: [[CLOSURE:%.*]] = call noalias %swift.refcounted* @swift_rt_swift_allocObject
|
// CHECK: [[CLOSURE:%.*]] = call noalias %swift.refcounted* @swift_rt_swift_allocObject
|
||||||
// CHECK: bitcast %swift.refcounted* [[CLOSURE]] to <{ %swift.refcounted, %T17indirect_argument4HugeV }>*
|
// CHECK: bitcast %swift.refcounted* [[CLOSURE]] to <{ %swift.refcounted, %T17indirect_argument4HugeV }>*
|
||||||
// CHECK: call void @llvm.memcpy
|
// CHECK: call swiftcc void @_T024huge_partial_applicationTA(%T17indirect_argument4HugeV* noalias nocapture dereferenceable({{.*}}) [[TMP_ARG]], %swift.refcounted* swiftself [[CLOSURE]])
|
||||||
// CHECK-64: call swiftcc void @_T024huge_partial_applicationTA(%T17indirect_argument4HugeV* noalias nocapture dereferenceable(40) %0, %swift.refcounted* swiftself [[CLOSURE]])
|
|
||||||
// CHECK-32: call swiftcc void @_T024huge_partial_applicationTA(%T17indirect_argument4HugeV* noalias nocapture dereferenceable(20) %0, %swift.refcounted* swiftself [[CLOSURE]])
|
|
||||||
// CHECK: define internal swiftcc void @_T024huge_partial_applicationTA(%T17indirect_argument4HugeV* noalias nocapture dereferenceable({{.*}}), %swift.refcounted* swiftself)
|
// CHECK: define internal swiftcc void @_T024huge_partial_applicationTA(%T17indirect_argument4HugeV* noalias nocapture dereferenceable({{.*}}), %swift.refcounted* swiftself)
|
||||||
// CHECK: [[TMP_ARG:%.*]] = alloca
|
// CHECK: [[TMP_ARG:%.*]] = alloca
|
||||||
// CHECK-NOT: tail
|
// CHECK-NOT: tail
|
||||||
@@ -79,10 +81,11 @@ entry(%x : $Huge, %y : $Huge):
|
|||||||
}
|
}
|
||||||
|
|
||||||
// CHECK-LABEL: define{{( protected)?}} swiftcc void @huge_partial_application_stret(%T17indirect_argument4HugeV* noalias nocapture sret, %T17indirect_argument4HugeV* noalias nocapture dereferenceable({{.*}}), %T17indirect_argument4HugeV* noalias nocapture dereferenceable({{.*}}))
|
// CHECK-LABEL: define{{( protected)?}} swiftcc void @huge_partial_application_stret(%T17indirect_argument4HugeV* noalias nocapture sret, %T17indirect_argument4HugeV* noalias nocapture dereferenceable({{.*}}), %T17indirect_argument4HugeV* noalias nocapture dereferenceable({{.*}}))
|
||||||
// CHECK: [[TMP:%.*]] = alloca
|
// CHECK: [[TMP_ARG:%.*]] = alloca
|
||||||
|
// CHECK: [[TMP_RET:%.*]] = alloca
|
||||||
// CHECK: [[CLOSURE:%.*]] = call noalias %swift.refcounted* @swift_rt_swift_allocObject
|
// CHECK: [[CLOSURE:%.*]] = call noalias %swift.refcounted* @swift_rt_swift_allocObject
|
||||||
// CHECK: bitcast %swift.refcounted* [[CLOSURE]] to <{ %swift.refcounted, %T17indirect_argument4HugeV }>*
|
// CHECK: bitcast %swift.refcounted* [[CLOSURE]] to <{ %swift.refcounted, %T17indirect_argument4HugeV }>*
|
||||||
// CHECK: call swiftcc void @_T030huge_partial_application_stretTA(%T17indirect_argument4HugeV* noalias nocapture sret [[TMP]], %T17indirect_argument4HugeV* noalias nocapture dereferenceable({{.*}}) %1, %swift.refcounted* swiftself [[CLOSURE]])
|
// CHECK: call swiftcc void @_T030huge_partial_application_stretTA(%T17indirect_argument4HugeV* noalias nocapture sret [[TMP_RET]], %T17indirect_argument4HugeV* noalias nocapture dereferenceable({{.*}}) [[TMP_ARG]], %swift.refcounted* swiftself [[CLOSURE]])
|
||||||
// CHECK: define internal swiftcc void @_T030huge_partial_application_stretTA(%T17indirect_argument4HugeV* noalias nocapture sret, %T17indirect_argument4HugeV* noalias nocapture dereferenceable({{.*}}), %swift.refcounted* swiftself)
|
// CHECK: define internal swiftcc void @_T030huge_partial_application_stretTA(%T17indirect_argument4HugeV* noalias nocapture sret, %T17indirect_argument4HugeV* noalias nocapture dereferenceable({{.*}}), %swift.refcounted* swiftself)
|
||||||
// CHECK: [[TMP_ARG:%.*]] = alloca
|
// CHECK: [[TMP_ARG:%.*]] = alloca
|
||||||
// CHECK-NOT: tail
|
// CHECK-NOT: tail
|
||||||
|
|||||||
@@ -58,11 +58,34 @@ entry(%b : $*Builtin.UnsafeValueBuffer, %v : $BigStruct):
|
|||||||
}
|
}
|
||||||
// CHECK-LABEL: define{{( protected)?}} swiftcc void @alloc_big([24 x i8]* nocapture dereferenceable({{.*}}), %T13value_buffers9BigStructV* noalias nocapture dereferenceable({{.*}}))
|
// CHECK-LABEL: define{{( protected)?}} swiftcc void @alloc_big([24 x i8]* nocapture dereferenceable({{.*}}), %T13value_buffers9BigStructV* noalias nocapture dereferenceable({{.*}}))
|
||||||
// CHECK-NEXT: entry:
|
// CHECK-NEXT: entry:
|
||||||
|
// CHECK: [[SLOT0:%.*]] = load i64
|
||||||
|
// CHECK: [[SLOT1:%.*]] = load i64
|
||||||
|
// CHECK: [[SLOT2:%.*]] = load i64
|
||||||
|
// CHECK: [[SLOT3:%.*]] = load i64
|
||||||
|
// CHECK: [[SLOT4:%.*]] = load i64
|
||||||
|
// CHECK: [[SLOT5:%.*]] = load i64
|
||||||
// CHECK-NEXT: [[T0:%.*]] = call noalias i8* @swift_rt_swift_slowAlloc(i64 48, i64 7)
|
// CHECK-NEXT: [[T0:%.*]] = call noalias i8* @swift_rt_swift_slowAlloc(i64 48, i64 7)
|
||||||
// CHECK-NEXT: [[T1:%.*]] = bitcast [24 x i8]* %0 to i8**
|
// CHECK-NEXT: [[T1:%.*]] = bitcast [24 x i8]* %0 to i8**
|
||||||
// CHECK-NEXT: store i8* [[T0]], i8** [[T1]], align 8
|
// CHECK-NEXT: store i8* [[T0]], i8** [[T1]], align 8
|
||||||
// CHECK-NEXT: [[ADDR:%.*]] = bitcast i8* [[T0]] to %T13value_buffers9BigStructV*
|
// CHECK-NEXT: [[ADDR:%.*]] = bitcast i8* [[T0]] to %T13value_buffers9BigStructV*
|
||||||
// CHECK: call void @llvm.memcpy
|
// CHECK-NEXT: [[T0:%.*]] = getelementptr inbounds %T13value_buffers9BigStructV, %T13value_buffers9BigStructV* [[ADDR]], i32 0, i32 0
|
||||||
|
// CHECK-NEXT: [[T1:%.*]] = getelementptr inbounds %TSi, %TSi* [[T0]], i32 0, i32 0
|
||||||
|
// CHECK-NEXT: store i64 [[SLOT0]], i64* [[T1]], align 8
|
||||||
|
// CHECK-NEXT: [[T0:%.*]] = getelementptr inbounds %T13value_buffers9BigStructV, %T13value_buffers9BigStructV* [[ADDR]], i32 0, i32 1
|
||||||
|
// CHECK-NEXT: [[T1:%.*]] = getelementptr inbounds %TSi, %TSi* [[T0]], i32 0, i32 0
|
||||||
|
// CHECK-NEXT: store i64 [[SLOT1]], i64* [[T1]], align 8
|
||||||
|
// CHECK-NEXT: [[T0:%.*]] = getelementptr inbounds %T13value_buffers9BigStructV, %T13value_buffers9BigStructV* [[ADDR]], i32 0, i32 2
|
||||||
|
// CHECK-NEXT: [[T1:%.*]] = getelementptr inbounds %TSi, %TSi* [[T0]], i32 0, i32 0
|
||||||
|
// CHECK-NEXT: store i64 [[SLOT2]], i64* [[T1]], align 8
|
||||||
|
// CHECK-NEXT: [[T0:%.*]] = getelementptr inbounds %T13value_buffers9BigStructV, %T13value_buffers9BigStructV* [[ADDR]], i32 0, i32 3
|
||||||
|
// CHECK-NEXT: [[T1:%.*]] = getelementptr inbounds %TSi, %TSi* [[T0]], i32 0, i32 0
|
||||||
|
// CHECK-NEXT: store i64 [[SLOT3]], i64* [[T1]], align 8
|
||||||
|
// CHECK-NEXT: [[T0:%.*]] = getelementptr inbounds %T13value_buffers9BigStructV, %T13value_buffers9BigStructV* [[ADDR]], i32 0, i32 4
|
||||||
|
// CHECK-NEXT: [[T1:%.*]] = getelementptr inbounds %TSi, %TSi* [[T0]], i32 0, i32 0
|
||||||
|
// CHECK-NEXT: store i64 [[SLOT4]], i64* [[T1]], align 8
|
||||||
|
// CHECK-NEXT: [[T0:%.*]] = getelementptr inbounds %T13value_buffers9BigStructV, %T13value_buffers9BigStructV* [[ADDR]], i32 0, i32 5
|
||||||
|
// CHECK-NEXT: [[T1:%.*]] = getelementptr inbounds %TSi, %TSi* [[T0]], i32 0, i32 0
|
||||||
|
// CHECK-NEXT: store i64 [[SLOT5]], i64* [[T1]], align 8
|
||||||
// CHECK-NEXT: ret void
|
// CHECK-NEXT: ret void
|
||||||
|
|
||||||
sil @project_big : $(@inout Builtin.UnsafeValueBuffer, BigStruct) -> () {
|
sil @project_big : $(@inout Builtin.UnsafeValueBuffer, BigStruct) -> () {
|
||||||
@@ -74,9 +97,32 @@ entry(%b : $*Builtin.UnsafeValueBuffer, %v : $BigStruct):
|
|||||||
}
|
}
|
||||||
// CHECK-LABEL: define{{( protected)?}} swiftcc void @project_big([24 x i8]* nocapture dereferenceable({{.*}}), %T13value_buffers9BigStructV* noalias nocapture dereferenceable({{.*}}))
|
// CHECK-LABEL: define{{( protected)?}} swiftcc void @project_big([24 x i8]* nocapture dereferenceable({{.*}}), %T13value_buffers9BigStructV* noalias nocapture dereferenceable({{.*}}))
|
||||||
// CHECK-NEXT: entry:
|
// CHECK-NEXT: entry:
|
||||||
|
// CHECK: [[SLOT0:%.*]] = load i64
|
||||||
|
// CHECK: [[SLOT1:%.*]] = load i64
|
||||||
|
// CHECK: [[SLOT2:%.*]] = load i64
|
||||||
|
// CHECK: [[SLOT3:%.*]] = load i64
|
||||||
|
// CHECK: [[SLOT4:%.*]] = load i64
|
||||||
|
// CHECK: [[SLOT5:%.*]] = load i64
|
||||||
// CHECK-NEXT: [[T0:%.*]] = bitcast [24 x i8]* %0 to %T13value_buffers9BigStructV**
|
// CHECK-NEXT: [[T0:%.*]] = bitcast [24 x i8]* %0 to %T13value_buffers9BigStructV**
|
||||||
// CHECK-NEXT: [[ADDR:%.*]] = load %T13value_buffers9BigStructV*, %T13value_buffers9BigStructV** [[T0]], align 8
|
// CHECK-NEXT: [[ADDR:%.*]] = load %T13value_buffers9BigStructV*, %T13value_buffers9BigStructV** [[T0]], align 8
|
||||||
// CHECK: call void @llvm.memcpy
|
// CHECK-NEXT: [[T0:%.*]] = getelementptr inbounds %T13value_buffers9BigStructV, %T13value_buffers9BigStructV* [[ADDR]], i32 0, i32 0
|
||||||
|
// CHECK-NEXT: [[T1:%.*]] = getelementptr inbounds %TSi, %TSi* [[T0]], i32 0, i32 0
|
||||||
|
// CHECK-NEXT: store i64 [[SLOT0]], i64* [[T1]], align 8
|
||||||
|
// CHECK-NEXT: [[T0:%.*]] = getelementptr inbounds %T13value_buffers9BigStructV, %T13value_buffers9BigStructV* [[ADDR]], i32 0, i32 1
|
||||||
|
// CHECK-NEXT: [[T1:%.*]] = getelementptr inbounds %TSi, %TSi* [[T0]], i32 0, i32 0
|
||||||
|
// CHECK-NEXT: store i64 [[SLOT1]], i64* [[T1]], align 8
|
||||||
|
// CHECK-NEXT: [[T0:%.*]] = getelementptr inbounds %T13value_buffers9BigStructV, %T13value_buffers9BigStructV* [[ADDR]], i32 0, i32 2
|
||||||
|
// CHECK-NEXT: [[T1:%.*]] = getelementptr inbounds %TSi, %TSi* [[T0]], i32 0, i32 0
|
||||||
|
// CHECK-NEXT: store i64 [[SLOT2]], i64* [[T1]], align 8
|
||||||
|
// CHECK-NEXT: [[T0:%.*]] = getelementptr inbounds %T13value_buffers9BigStructV, %T13value_buffers9BigStructV* [[ADDR]], i32 0, i32 3
|
||||||
|
// CHECK-NEXT: [[T1:%.*]] = getelementptr inbounds %TSi, %TSi* [[T0]], i32 0, i32 0
|
||||||
|
// CHECK-NEXT: store i64 [[SLOT3]], i64* [[T1]], align 8
|
||||||
|
// CHECK-NEXT: [[T0:%.*]] = getelementptr inbounds %T13value_buffers9BigStructV, %T13value_buffers9BigStructV* [[ADDR]], i32 0, i32 4
|
||||||
|
// CHECK-NEXT: [[T1:%.*]] = getelementptr inbounds %TSi, %TSi* [[T0]], i32 0, i32 0
|
||||||
|
// CHECK-NEXT: store i64 [[SLOT4]], i64* [[T1]], align 8
|
||||||
|
// CHECK-NEXT: [[T0:%.*]] = getelementptr inbounds %T13value_buffers9BigStructV, %T13value_buffers9BigStructV* [[ADDR]], i32 0, i32 5
|
||||||
|
// CHECK-NEXT: [[T1:%.*]] = getelementptr inbounds %TSi, %TSi* [[T0]], i32 0, i32 0
|
||||||
|
// CHECK-NEXT: store i64 [[SLOT5]], i64* [[T1]], align 8
|
||||||
// CHECK-NEXT: ret void
|
// CHECK-NEXT: ret void
|
||||||
|
|
||||||
sil @dealloc_big : $(@inout Builtin.UnsafeValueBuffer) -> () {
|
sil @dealloc_big : $(@inout Builtin.UnsafeValueBuffer) -> () {
|
||||||
|
|||||||
@@ -6,9 +6,9 @@
|
|||||||
// CHECK: [[TYPE:%swift.type]] = type
|
// CHECK: [[TYPE:%swift.type]] = type
|
||||||
// CHECK: [[OPAQUE:%swift.opaque]] = type opaque
|
// CHECK: [[OPAQUE:%swift.opaque]] = type opaque
|
||||||
// CHECK: [[C:%T4weak1CC]] = type <{ [[REF:%swift.refcounted]] }>
|
// CHECK: [[C:%T4weak1CC]] = type <{ [[REF:%swift.refcounted]] }>
|
||||||
// CHECK: [[UNKNOWN:%objc_object]] = type opaque
|
|
||||||
// CHECK: [[A:%T4weak1AV]] = type <{ [[WEAK:%swift.weak]] }>
|
// CHECK: [[A:%T4weak1AV]] = type <{ [[WEAK:%swift.weak]] }>
|
||||||
// CHECK: [[WEAK]] = type
|
// CHECK: [[WEAK]] = type
|
||||||
|
// CHECK: [[UNKNOWN:%objc_object]] = type opaque
|
||||||
// CHECK: [[B:%T4weak1BV]] = type <{ { [[WEAK]], i8** } }>
|
// CHECK: [[B:%T4weak1BV]] = type <{ { [[WEAK]], i8** } }>
|
||||||
|
|
||||||
sil_stage canonical
|
sil_stage canonical
|
||||||
|
|||||||
@@ -425,8 +425,8 @@ test_spare_bit_aggregate(.x(22, 44))
|
|||||||
// CHECK: X(222)
|
// CHECK: X(222)
|
||||||
// CHECK: X(444)
|
// CHECK: X(444)
|
||||||
// CHECK: .y(222, 444)
|
// CHECK: .y(222, 444)
|
||||||
// CHECK-DAG-64: ~X(222)
|
// CHECK-DAG: ~X(222)
|
||||||
// CHECK-DAG-64: ~X(444)
|
// CHECK-DAG: ~X(444)
|
||||||
test_spare_bit_aggregate(.y(Rdar15383966(222), Rdar15383966(444)))
|
test_spare_bit_aggregate(.y(Rdar15383966(222), Rdar15383966(444)))
|
||||||
// CHECK: .z(S(a: 333, b: 666))
|
// CHECK: .z(S(a: 333, b: 666))
|
||||||
test_spare_bit_aggregate(.z(S(333, 666)))
|
test_spare_bit_aggregate(.z(S(333, 666)))
|
||||||
|
|||||||
Reference in New Issue
Block a user