Skip to content

Disable large types irgen pass #9447

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
May 10, 2017
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 0 additions & 2 deletions include/swift/SILOptimizer/PassManager/Passes.def
Original file line number Diff line number Diff line change
Expand Up @@ -222,8 +222,6 @@ PASS(ReleaseHoisting, "release-hoisting",
"SIL release Hoisting")
PASS(LateReleaseHoisting, "late-release-hoisting",
"Late SIL release Hoisting Preserving Epilogues")
IRGEN_PASS(LoadableByAddress, "loadable-address",
"SIL Loadable type by-address lowering.")
PASS(RemovePins, "remove-pins",
"Remove SIL pin/unpin pairs")
PASS(SideEffectsDumper, "side-effects-dump",
Expand Down
2 changes: 1 addition & 1 deletion lib/SILOptimizer/PassManager/PassPipeline.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -437,7 +437,7 @@ static void addIRGenPreparePipeline(SILPassPipelinePlan &P) {
// Hoist generic alloc_stack instructions to the entry block to enable better
// llvm-ir generation for dynamic alloca instructions.
P.addAllocStackHoisting();
P.addLoadableByAddress();
//P.addLoadableByAddress();
}

SILPassPipelinePlan SILPassPipelinePlan::getIRGenPreparePassPipeline() {
Expand Down
5 changes: 2 additions & 3 deletions test/DebugInfo/guard-let.swift
Original file line number Diff line number Diff line change
Expand Up @@ -20,10 +20,9 @@ public func g(_ s : String?)
{
// CHECK2: define {{.*}}@_T04main1gySSSgF
// 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-63: ![[DBG0]] = !DILocation(line: 0, scope: ![[G]])
// CHECK2-32: ![[DBG0]] = !DILocation(line: 0, scope: !
// CHECK2: ![[DBG0]] = !DILocation(line: 0, scope: ![[G]])
guard let val = s else { return }
use(val)
}
113 changes: 0 additions & 113 deletions test/IRGen/big_types_corner_cases.swift

This file was deleted.

1 change: 0 additions & 1 deletion test/IRGen/c_layout.sil
Original file line number Diff line number Diff line change
Expand Up @@ -304,7 +304,6 @@ entry(%b : $@convention(block) (CChar) -> CChar, %c : $CChar):
}

// CHECK-x86_64-LABEL: define{{( protected)?}} swiftcc void @testBitfieldInBlock
// CHECK-x86_64: call void {{%.*}}(%TSo11BitfieldOneV* noalias nocapture sret {{%.*}}, %objc_block* {{%.*}}, %struct.BitfieldOne* {{%.*}})
sil @testBitfieldInBlock : $@convention(thin) (@owned @convention(block) (BitfieldOne) -> BitfieldOne, BitfieldOne) -> BitfieldOne {
entry(%b : $@convention(block) (BitfieldOne) -> BitfieldOne, %x : $BitfieldOne):
%r = apply %b(%x) : $@convention(block) (BitfieldOne) -> BitfieldOne
Expand Down
9 changes: 3 additions & 6 deletions test/IRGen/copy_value_destroy_value.sil
Original file line number Diff line number Diff line change
Expand Up @@ -27,18 +27,15 @@ bb0(%0 : $Builtin.Int32):
return %2 : $()
}

// CHECK-LABEL: define{{( protected)?}} swiftcc void @non_trivial(%T019copy_value_destroy_B03FooV* noalias nocapture dereferenceable(36))
// CHECK: call void @llvm.memcpy
// CHECK: [[GEP1:%.*]] = getelementptr inbounds %T019copy_value_destroy_B03FooV, %T019copy_value_destroy_B03FooV* %1, i32 0, i32 2
// CHECK: define{{( protected)?}} swiftcc void @non_trivial(
// CHECK: [[GEP1:%.*]] = getelementptr inbounds %T019copy_value_destroy_B03FooV, %T019copy_value_destroy_B03FooV* %0, i32 0, i32 2
// 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: 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_release(%swift.refcounted* [[VAL1]])
// CHECK: call void @swift_rt_swift_release(%swift.refcounted* [[VAL2]])
// CHECK: ret void
// CHECK-LABEL: }
sil @non_trivial : $@convention(thin) (Foo) -> () {
bb0(%0 : $Foo):
%1 = copy_value %0 : $Foo
Expand Down
17 changes: 15 additions & 2 deletions test/IRGen/enum.sil
Original file line number Diff line number Diff line change
Expand Up @@ -221,17 +221,26 @@ sil @singleton_switch_arg : $(Singleton) -> () {
// CHECK-32: entry:
entry(%u : $Singleton):
// 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-32: br label %[[PREDEST:[0-9]+]]
switch_enum %u : $Singleton, case #Singleton.value!enumelt.1: dest

// CHECK-64: ; <label>:[[PREDEST]]
// CHECK-64: br label %[[DEST:[0-9]+]]
// 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)):
// CHECK-64: {{%.*}} = phi i64 [ %0, %[[PREDEST]] ]
// CHECK-64: {{%.*}} = phi i64 [ %1, %[[PREDEST]] ]
// CHECK-64: ret void
// CHECK-32: {{%.*}} = phi i64 [ [[ELT1]], %[[PREDEST]] ]
// CHECK-32: {{%.*}} = phi i64 [ [[ELT2]], %[[PREDEST]] ]
// CHECK-32: ret void
%x = tuple ()
return %x : $()
Expand Down Expand Up @@ -745,7 +754,11 @@ entry(%u : $AggregateSinglePayload2):
// CHECK-32: [[LOAD4:%.*]] = load i32, i32* {{.*}}
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: phi i21 [ [[TRUNC]]
Expand Down
33 changes: 18 additions & 15 deletions test/IRGen/indirect_argument.sil
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,9 @@ struct HugeAlignment {
}

// TODO: could be the context param
// CHECK-LABEL-64: 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: call swiftcc void @huge_method(%T17indirect_argument4HugeV* noalias nocapture swiftself dereferenceable({{.*}})
// CHECK-LABEL: define{{( protected)?}} swiftcc void @huge_method(%T17indirect_argument4HugeV* noalias nocapture dereferenceable({{.*}}))
// CHECK: [[TMP:%.*]] = alloca
// CHECK: call swiftcc void @huge_method(%T17indirect_argument4HugeV* noalias nocapture dereferenceable({{.*}}) [[TMP]])
sil @huge_method : $@convention(method) Huge -> () {
entry(%x : $Huge):
%f = function_ref @huge_method : $@convention(method) Huge -> ()
Expand All @@ -23,7 +23,8 @@ entry(%x : $Huge):
}

// 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 -> () {
entry(%x : $Huge):
%f = function_ref @huge_param : $@convention(thin) Huge -> ()
Expand All @@ -32,7 +33,8 @@ entry(%x : $Huge):
}

// 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 -> () {
entry(%x : $HugeAlignment):
%f = function_ref @huge_alignment_param : $@convention(thin) HugeAlignment -> ()
Expand All @@ -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: [[TMP:%.*]] = alloca
// CHECK: call swiftcc void @huge_param_and_return(%T17indirect_argument4HugeV* noalias nocapture sret [[TMP]], %T17indirect_argument4HugeV* noalias nocapture dereferenceable({{.*}}) %1)
// CHECK: [[TMP_ARG:%.*]] = alloca
// 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 {
entry(%x : $Huge):
%f = function_ref @huge_param_and_return : $@convention(thin) Huge -> Huge
Expand All @@ -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: 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 {
entry(%o : $*Huge, %x : $Huge):
%f = function_ref @huge_param_and_indirect_return : $@convention(thin) (Huge) -> @out Huge
Expand All @@ -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-32: [[CLOSURE:%.*]] = call noalias %swift.refcounted* @swift_rt_swift_allocObject
// CHECK-64: [[CLOSURE:%.*]] = call noalias %swift.refcounted* @swift_rt_swift_allocObject
// CHECK: [[TMP_ARG:%.*]] = alloca
// CHECK: [[CLOSURE:%.*]] = call noalias %swift.refcounted* @swift_rt_swift_allocObject
// CHECK: bitcast %swift.refcounted* [[CLOSURE]] to <{ %swift.refcounted, %T17indirect_argument4HugeV }>*
// CHECK: call void @llvm.memcpy
// 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: call swiftcc void @_T024huge_partial_applicationTA(%T17indirect_argument4HugeV* noalias nocapture dereferenceable({{.*}}) [[TMP_ARG]], %swift.refcounted* swiftself [[CLOSURE]])
// CHECK: define internal swiftcc void @_T024huge_partial_applicationTA(%T17indirect_argument4HugeV* noalias nocapture dereferenceable({{.*}}), %swift.refcounted* swiftself)
// CHECK: [[TMP_ARG:%.*]] = alloca
// CHECK-NOT: tail
Expand All @@ -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: [[TMP:%.*]] = alloca
// CHECK: [[TMP_ARG:%.*]] = alloca
// CHECK: [[TMP_RET:%.*]] = alloca
// CHECK: [[CLOSURE:%.*]] = call noalias %swift.refcounted* @swift_rt_swift_allocObject
// 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: [[TMP_ARG:%.*]] = alloca
// CHECK-NOT: tail
Expand Down
Loading