Skip to content

Commit 440928c

Browse files
author
Joe Shajrawi
authored
Merge pull request #9447 from apple/disable_large_types_irgen_pass
Disable large types irgen pass
2 parents 84275b1 + d721f72 commit 440928c

File tree

11 files changed

+90
-148
lines changed

11 files changed

+90
-148
lines changed

include/swift/SILOptimizer/PassManager/Passes.def

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -222,8 +222,6 @@ PASS(ReleaseHoisting, "release-hoisting",
222222
"SIL release Hoisting")
223223
PASS(LateReleaseHoisting, "late-release-hoisting",
224224
"Late SIL release Hoisting Preserving Epilogues")
225-
IRGEN_PASS(LoadableByAddress, "loadable-address",
226-
"SIL Loadable type by-address lowering.")
227225
PASS(RemovePins, "remove-pins",
228226
"Remove SIL pin/unpin pairs")
229227
PASS(SideEffectsDumper, "side-effects-dump",

lib/SILOptimizer/PassManager/PassPipeline.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -437,7 +437,7 @@ static void addIRGenPreparePipeline(SILPassPipelinePlan &P) {
437437
// Hoist generic alloc_stack instructions to the entry block to enable better
438438
// llvm-ir generation for dynamic alloca instructions.
439439
P.addAllocStackHoisting();
440-
P.addLoadableByAddress();
440+
//P.addLoadableByAddress();
441441
}
442442

443443
SILPassPipelinePlan SILPassPipelinePlan::getIRGenPreparePassPipeline() {

test/DebugInfo/guard-let.swift

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -20,10 +20,9 @@ public func g(_ s : String?)
2020
{
2121
// CHECK2: define {{.*}}@_T04main1gySSSgF
2222
// The shadow copy store should not have a location.
23-
// CHECK2-64: getelementptr inbounds {{.*}} %s.debug, {{.*}}, !dbg ![[DBG0:.*]]
23+
// CHECK2: getelementptr inbounds {{.*}} %s.debug, {{.*}}, !dbg ![[DBG0:.*]]
2424
// CHECK2: ![[G:.*]] = distinct !DISubprogram(name: "g",
25-
// CHECK2-63: ![[DBG0]] = !DILocation(line: 0, scope: ![[G]])
26-
// CHECK2-32: ![[DBG0]] = !DILocation(line: 0, scope: !
25+
// CHECK2: ![[DBG0]] = !DILocation(line: 0, scope: ![[G]])
2726
guard let val = s else { return }
2827
use(val)
2928
}

test/IRGen/big_types_corner_cases.swift

Lines changed: 0 additions & 113 deletions
This file was deleted.

test/IRGen/c_layout.sil

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -304,7 +304,6 @@ entry(%b : $@convention(block) (CChar) -> CChar, %c : $CChar):
304304
}
305305

306306
// CHECK-x86_64-LABEL: define{{( protected)?}} swiftcc void @testBitfieldInBlock
307-
// CHECK-x86_64: call void {{%.*}}(%TSo11BitfieldOneV* noalias nocapture sret {{%.*}}, %objc_block* {{%.*}}, %struct.BitfieldOne* {{%.*}})
308307
sil @testBitfieldInBlock : $@convention(thin) (@owned @convention(block) (BitfieldOne) -> BitfieldOne, BitfieldOne) -> BitfieldOne {
309308
entry(%b : $@convention(block) (BitfieldOne) -> BitfieldOne, %x : $BitfieldOne):
310309
%r = apply %b(%x) : $@convention(block) (BitfieldOne) -> BitfieldOne

test/IRGen/copy_value_destroy_value.sil

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -27,18 +27,15 @@ bb0(%0 : $Builtin.Int32):
2727
return %2 : $()
2828
}
2929

30-
// CHECK-LABEL: define{{( protected)?}} swiftcc void @non_trivial(%T019copy_value_destroy_B03FooV* noalias nocapture dereferenceable(36))
31-
// CHECK: call void @llvm.memcpy
32-
// CHECK: [[GEP1:%.*]] = getelementptr inbounds %T019copy_value_destroy_B03FooV, %T019copy_value_destroy_B03FooV* %1, i32 0, i32 2
30+
// CHECK: define{{( protected)?}} swiftcc void @non_trivial(
31+
// CHECK: [[GEP1:%.*]] = getelementptr inbounds %T019copy_value_destroy_B03FooV, %T019copy_value_destroy_B03FooV* %0, i32 0, i32 2
3332
// CHECK: [[VAL1:%.*]] = load %swift.refcounted*, %swift.refcounted** [[GEP1]], align 8
34-
// CHECK: [[GEP2:%.*]] = getelementptr inbounds %T019copy_value_destroy_B03FooV, %T019copy_value_destroy_B03FooV* %1, i32 0, i32 5
33+
// CHECK: [[GEP2:%.*]] = getelementptr inbounds %T019copy_value_destroy_B03FooV, %T019copy_value_destroy_B03FooV* %0, i32 0, i32 5
3534
// CHECK: [[VAL2:%.*]] = load %swift.refcounted*, %swift.refcounted** [[GEP2]], align 8
3635
// CHECK: call void @swift_rt_swift_retain(%swift.refcounted* [[VAL1]])
3736
// CHECK: call void @swift_rt_swift_retain(%swift.refcounted* [[VAL2]])
3837
// CHECK: call void @swift_rt_swift_release(%swift.refcounted* [[VAL1]])
3938
// CHECK: call void @swift_rt_swift_release(%swift.refcounted* [[VAL2]])
40-
// CHECK: ret void
41-
// CHECK-LABEL: }
4239
sil @non_trivial : $@convention(thin) (Foo) -> () {
4340
bb0(%0 : $Foo):
4441
%1 = copy_value %0 : $Foo

test/IRGen/enum.sil

Lines changed: 15 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -221,17 +221,26 @@ sil @singleton_switch_arg : $(Singleton) -> () {
221221
// CHECK-32: entry:
222222
entry(%u : $Singleton):
223223
// CHECK-32: [[CAST:%.*]] = bitcast %T4enum9SingletonO* %0 to <{ i64, i64 }>*
224-
// CHECK-32: call void @llvm.memcpy.p0i8.p0i8.i32
224+
// CHECK-32: [[GEP1:%.*]] = getelementptr inbounds <{ i64, i64 }>, <{ i64, i64 }>* [[CAST]], i32 0, i32 0
225+
// CHECK-32: [[ELT1:%.*]] = load i64, i64* [[GEP1]]
226+
// CHECK-32: [[GEP2:%.*]] = getelementptr inbounds <{ i64, i64 }>, <{ i64, i64 }>* [[CAST]], i32 0, i32 1
227+
// CHECK-32: [[ELT2:%.*]] = load i64, i64* [[GEP2]]
225228
// CHECK-64: br label %[[PREDEST:[0-9]+]]
229+
// CHECK-32: br label %[[PREDEST:[0-9]+]]
226230
switch_enum %u : $Singleton, case #Singleton.value!enumelt.1: dest
227231

228232
// CHECK-64: ; <label>:[[PREDEST]]
229233
// CHECK-64: br label %[[DEST:[0-9]+]]
230234
// CHECK-64: ; <label>:[[DEST]]
235+
// CHECK-32: ; <label>:[[PREDEST]]
236+
// CHECK-32: br label %[[DEST:[0-9]+]]
237+
// CHECK-32: ; <label>:[[DEST]]
231238
dest(%u2 : $(Builtin.Int64, Builtin.Int64)):
232239
// CHECK-64: {{%.*}} = phi i64 [ %0, %[[PREDEST]] ]
233240
// CHECK-64: {{%.*}} = phi i64 [ %1, %[[PREDEST]] ]
234241
// CHECK-64: ret void
242+
// CHECK-32: {{%.*}} = phi i64 [ [[ELT1]], %[[PREDEST]] ]
243+
// CHECK-32: {{%.*}} = phi i64 [ [[ELT2]], %[[PREDEST]] ]
235244
// CHECK-32: ret void
236245
%x = tuple ()
237246
return %x : $()
@@ -745,7 +754,11 @@ entry(%u : $AggregateSinglePayload2):
745754
// CHECK-32: [[LOAD4:%.*]] = load i32, i32* {{.*}}
746755
switch_enum %u : $AggregateSinglePayload2, case #AggregateSinglePayload2.x!enumelt.1: x_dest, default end
747756

748-
// CHECK-32: call void @llvm.memcpy.p0i8.p0i8.i32
757+
// CHECK-32: [[TRUNC:%.*]] = trunc [[WORD]] [[LOAD1]] to i21
758+
// CHECK-32: phi i21 [ [[TRUNC]]
759+
// CHECK-32: phi [[WORD]] [ [[LOAD2]]
760+
// CHECK-32: phi [[WORD]] [ [[LOAD3]]
761+
// CHECK-32: phi [[WORD]] [ [[LOAD4]]
749762

750763
// CHECK-64: [[TRUNC:%.*]] = trunc [[WORD]] %0 to i21
751764
// CHECK-64: phi i21 [ [[TRUNC]]

test/IRGen/indirect_argument.sil

Lines changed: 18 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -12,9 +12,9 @@ struct HugeAlignment {
1212
}
1313

1414
// TODO: could be the context param
15-
// CHECK-LABEL-64: define{{( protected)?}} swiftcc void @huge_method(%T17indirect_argument4HugeV* noalias nocapture dereferenceable({{.*}}))
16-
// CHECK-LABEL-32: define{{( protected)?}} swiftcc void @huge_method(%T17indirect_argument4HugeV* noalias nocapture swiftself dereferenceable({{.*}}))
17-
// CHECK: call swiftcc void @huge_method(%T17indirect_argument4HugeV* noalias nocapture swiftself dereferenceable({{.*}})
15+
// CHECK-LABEL: define{{( protected)?}} swiftcc void @huge_method(%T17indirect_argument4HugeV* noalias nocapture dereferenceable({{.*}}))
16+
// CHECK: [[TMP:%.*]] = alloca
17+
// CHECK: call swiftcc void @huge_method(%T17indirect_argument4HugeV* noalias nocapture dereferenceable({{.*}}) [[TMP]])
1818
sil @huge_method : $@convention(method) Huge -> () {
1919
entry(%x : $Huge):
2020
%f = function_ref @huge_method : $@convention(method) Huge -> ()
@@ -23,7 +23,8 @@ entry(%x : $Huge):
2323
}
2424

2525
// CHECK-LABEL: define{{( protected)?}} swiftcc void @huge_param(%T17indirect_argument4HugeV* noalias nocapture dereferenceable({{.*}}))
26-
// CHECK: call swiftcc void @huge_param(%T17indirect_argument4HugeV* noalias nocapture dereferenceable({{.*}}) %0)
26+
// CHECK: [[TMP:%.*]] = alloca
27+
// CHECK: call swiftcc void @huge_param(%T17indirect_argument4HugeV* noalias nocapture dereferenceable({{.*}}) [[TMP]])
2728
sil @huge_param : $@convention(thin) Huge -> () {
2829
entry(%x : $Huge):
2930
%f = function_ref @huge_param : $@convention(thin) Huge -> ()
@@ -32,7 +33,8 @@ entry(%x : $Huge):
3233
}
3334

3435
// CHECK-LABEL: define{{( protected)?}} swiftcc void @huge_alignment_param(%T17indirect_argument13HugeAlignmentV* noalias nocapture dereferenceable({{.*}}))
35-
// CHECK: call swiftcc void @huge_alignment_param(%T17indirect_argument13HugeAlignmentV* noalias nocapture dereferenceable({{.*}}) %0)
36+
// CHECK: [[TMP:%.*]] = alloca
37+
// CHECK: call swiftcc void @huge_alignment_param(%T17indirect_argument13HugeAlignmentV* noalias nocapture dereferenceable({{.*}}) [[TMP]])
3638
sil @huge_alignment_param : $@convention(thin) HugeAlignment -> () {
3739
entry(%x : $HugeAlignment):
3840
%f = function_ref @huge_alignment_param : $@convention(thin) HugeAlignment -> ()
@@ -41,8 +43,9 @@ entry(%x : $HugeAlignment):
4143
}
4244

4345
// CHECK-LABEL: define{{( protected)?}} swiftcc void @huge_param_and_return(%T17indirect_argument4HugeV* noalias nocapture sret, %T17indirect_argument4HugeV* noalias nocapture dereferenceable({{.*}}))
44-
// CHECK: [[TMP:%.*]] = alloca
45-
// CHECK: call swiftcc void @huge_param_and_return(%T17indirect_argument4HugeV* noalias nocapture sret [[TMP]], %T17indirect_argument4HugeV* noalias nocapture dereferenceable({{.*}}) %1)
46+
// CHECK: [[TMP_ARG:%.*]] = alloca
47+
// CHECK: [[TMP_RET:%.*]] = alloca
48+
// CHECK: call swiftcc void @huge_param_and_return(%T17indirect_argument4HugeV* noalias nocapture sret [[TMP_RET]], %T17indirect_argument4HugeV* noalias nocapture dereferenceable({{.*}}) [[TMP_ARG]])
4649
sil @huge_param_and_return : $@convention(thin) Huge -> Huge {
4750
entry(%x : $Huge):
4851
%f = function_ref @huge_param_and_return : $@convention(thin) Huge -> Huge
@@ -51,7 +54,8 @@ entry(%x : $Huge):
5154
}
5255

5356
// CHECK-LABEL: define{{( protected)?}} swiftcc void @huge_param_and_indirect_return(%T17indirect_argument4HugeV* noalias nocapture sret, %T17indirect_argument4HugeV* noalias nocapture dereferenceable({{.*}}))
54-
// CHECK: call swiftcc void @huge_param_and_indirect_return(%T17indirect_argument4HugeV* noalias nocapture sret %0, %T17indirect_argument4HugeV* noalias nocapture dereferenceable({{.*}}) %1)
57+
// CHECK: [[TMP_ARG:%.*]] = alloca
58+
// CHECK: call swiftcc void @huge_param_and_indirect_return(%T17indirect_argument4HugeV* noalias nocapture sret %0, %T17indirect_argument4HugeV* noalias nocapture dereferenceable({{.*}}) [[TMP_ARG]])
5559
sil @huge_param_and_indirect_return : $@convention(thin) (Huge) -> @out Huge {
5660
entry(%o : $*Huge, %x : $Huge):
5761
%f = function_ref @huge_param_and_indirect_return : $@convention(thin) (Huge) -> @out Huge
@@ -60,12 +64,10 @@ entry(%o : $*Huge, %x : $Huge):
6064
}
6165

6266
// CHECK-LABEL: define{{( protected)?}} swiftcc void @huge_partial_application(%T17indirect_argument4HugeV* noalias nocapture dereferenceable({{.*}}), %T17indirect_argument4HugeV* noalias nocapture dereferenceable({{.*}}))
63-
// CHECK-32: [[CLOSURE:%.*]] = call noalias %swift.refcounted* @swift_rt_swift_allocObject
64-
// CHECK-64: [[CLOSURE:%.*]] = call noalias %swift.refcounted* @swift_rt_swift_allocObject
67+
// CHECK: [[TMP_ARG:%.*]] = alloca
68+
// CHECK: [[CLOSURE:%.*]] = call noalias %swift.refcounted* @swift_rt_swift_allocObject
6569
// CHECK: bitcast %swift.refcounted* [[CLOSURE]] to <{ %swift.refcounted, %T17indirect_argument4HugeV }>*
66-
// CHECK: call void @llvm.memcpy
67-
// CHECK-64: call swiftcc void @_T024huge_partial_applicationTA(%T17indirect_argument4HugeV* noalias nocapture dereferenceable(40) %0, %swift.refcounted* swiftself [[CLOSURE]])
68-
// CHECK-32: call swiftcc void @_T024huge_partial_applicationTA(%T17indirect_argument4HugeV* noalias nocapture dereferenceable(20) %0, %swift.refcounted* swiftself [[CLOSURE]])
70+
// CHECK: call swiftcc void @_T024huge_partial_applicationTA(%T17indirect_argument4HugeV* noalias nocapture dereferenceable({{.*}}) [[TMP_ARG]], %swift.refcounted* swiftself [[CLOSURE]])
6971
// CHECK: define internal swiftcc void @_T024huge_partial_applicationTA(%T17indirect_argument4HugeV* noalias nocapture dereferenceable({{.*}}), %swift.refcounted* swiftself)
7072
// CHECK: [[TMP_ARG:%.*]] = alloca
7173
// CHECK-NOT: tail
@@ -79,10 +81,11 @@ entry(%x : $Huge, %y : $Huge):
7981
}
8082

8183
// 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({{.*}}))
82-
// CHECK: [[TMP:%.*]] = alloca
84+
// CHECK: [[TMP_ARG:%.*]] = alloca
85+
// CHECK: [[TMP_RET:%.*]] = alloca
8386
// CHECK: [[CLOSURE:%.*]] = call noalias %swift.refcounted* @swift_rt_swift_allocObject
8487
// CHECK: bitcast %swift.refcounted* [[CLOSURE]] to <{ %swift.refcounted, %T17indirect_argument4HugeV }>*
85-
// CHECK: call swiftcc void @_T030huge_partial_application_stretTA(%T17indirect_argument4HugeV* noalias nocapture sret [[TMP]], %T17indirect_argument4HugeV* noalias nocapture dereferenceable({{.*}}) %1, %swift.refcounted* swiftself [[CLOSURE]])
88+
// 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]])
8689
// CHECK: define internal swiftcc void @_T030huge_partial_application_stretTA(%T17indirect_argument4HugeV* noalias nocapture sret, %T17indirect_argument4HugeV* noalias nocapture dereferenceable({{.*}}), %swift.refcounted* swiftself)
8790
// CHECK: [[TMP_ARG:%.*]] = alloca
8891
// CHECK-NOT: tail

0 commit comments

Comments
 (0)