Skip to content

Commit 896d7d0

Browse files
author
Joe Shajrawi
committed
Merge pull request #9165 from shajrawi/fix_linux_build
Fix runtime failure on Linux due to large values by address pass
1 parent 37de124 commit 896d7d0

File tree

2 files changed

+3
-18
lines changed

2 files changed

+3
-18
lines changed

lib/IRGen/LoadableByAddress.cpp

Lines changed: 0 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -97,10 +97,6 @@ static bool modifiableFunction(CanSILFunctionType funcType) {
9797
// C functions should use the old ABI
9898
return false;
9999
}
100-
if (funcType->getRepresentation() == SILFunctionTypeRepresentation::Method) {
101-
// C functions should use the old ABI
102-
return false;
103-
}
104100
return true;
105101
}
106102

@@ -396,10 +392,6 @@ static bool modifiableApply(ApplySite applySite, irgen::IRGenModule &Mod) {
396392
SILFunctionTypeRepresentation::CFunctionPointer) {
397393
return false;
398394
}
399-
if (applySite.getSubstCalleeType()->getRepresentation() ==
400-
SILFunctionTypeRepresentation::Method) {
401-
return false;
402-
}
403395
auto callee = applySite.getCallee();
404396
if (dyn_cast<ProjectBlockStorageInst>(callee)) {
405397
return false;
@@ -433,9 +425,6 @@ void LargeValueVisitor::visitApply(ApplySite applySite) {
433425
}
434426

435427
static bool isMethodInstUnmodifiable(MethodInst *instr) {
436-
if (dyn_cast<ClassMethodInst>(instr)) {
437-
return true;
438-
}
439428
for (auto *user : instr->getUses()) {
440429
if (ApplySite::isa(user->getUser())) {
441430
ApplySite applySite = ApplySite(user->getUser());
@@ -447,10 +436,6 @@ static bool isMethodInstUnmodifiable(MethodInst *instr) {
447436
SILFunctionTypeRepresentation::CFunctionPointer) {
448437
return true;
449438
}
450-
if (applySite.getSubstCalleeType()->getRepresentation() ==
451-
SILFunctionTypeRepresentation::Method) {
452-
return true;
453-
}
454439
}
455440
}
456441
return false;

test/IRGen/indirect_argument.sil

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -14,8 +14,7 @@ struct HugeAlignment {
1414
// TODO: could be the context param
1515
// CHECK-LABEL-64: define{{( protected)?}} swiftcc void @huge_method(%T17indirect_argument4HugeV* noalias nocapture dereferenceable({{.*}}))
1616
// CHECK-LABEL-32: define{{( protected)?}} swiftcc void @huge_method(%T17indirect_argument4HugeV* noalias nocapture swiftself dereferenceable({{.*}}))
17-
// CHECK-64: call swiftcc void @huge_method(%T17indirect_argument4HugeV* noalias nocapture dereferenceable({{.*}})
18-
// CHECK-32: call swiftcc void @huge_method(%T17indirect_argument4HugeV* noalias nocapture swiftself dereferenceable({{.*}})
17+
// CHECK: call swiftcc void @huge_method(%T17indirect_argument4HugeV* noalias nocapture swiftself dereferenceable({{.*}})
1918
sil @huge_method : $@convention(method) Huge -> () {
2019
entry(%x : $Huge):
2120
%f = function_ref @huge_method : $@convention(method) Huge -> ()
@@ -61,7 +60,8 @@ entry(%o : $*Huge, %x : $Huge):
6160
}
6261

6362
// CHECK-LABEL: define{{( protected)?}} swiftcc void @huge_partial_application(%T17indirect_argument4HugeV* noalias nocapture dereferenceable({{.*}}), %T17indirect_argument4HugeV* noalias nocapture dereferenceable({{.*}}))
64-
// CHECK: [[CLOSURE:%.*]] = call noalias %swift.refcounted* @swift_rt_swift_allocObject
63+
// CHECK-32: [[CLOSURE:%.*]] = call noalias %swift.refcounted* @swift_rt_swift_allocObject
64+
// CHECK-64: [[CLOSURE:%.*]] = call noalias %swift.refcounted* @swift_rt_swift_allocObject
6565
// CHECK: bitcast %swift.refcounted* [[CLOSURE]] to <{ %swift.refcounted, %T17indirect_argument4HugeV }>*
6666
// CHECK: call void @llvm.memcpy
6767
// CHECK-64: call swiftcc void @_T024huge_partial_applicationTA(%T17indirect_argument4HugeV* noalias nocapture dereferenceable(40) %0, %swift.refcounted* swiftself [[CLOSURE]])

0 commit comments

Comments
 (0)