Skip to content

Fix runtime failure on Linux due to large values by address pass #9165

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 2, 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
15 changes: 0 additions & 15 deletions lib/IRGen/LoadableByAddress.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -97,10 +97,6 @@ static bool modifiableFunction(CanSILFunctionType funcType) {
// C functions should use the old ABI
return false;
}
if (funcType->getRepresentation() == SILFunctionTypeRepresentation::Method) {
// C functions should use the old ABI
return false;
}
return true;
}

Expand Down Expand Up @@ -396,10 +392,6 @@ static bool modifiableApply(ApplySite applySite, irgen::IRGenModule &Mod) {
SILFunctionTypeRepresentation::CFunctionPointer) {
return false;
}
if (applySite.getSubstCalleeType()->getRepresentation() ==
SILFunctionTypeRepresentation::Method) {
return false;
}
auto callee = applySite.getCallee();
if (dyn_cast<ProjectBlockStorageInst>(callee)) {
return false;
Expand Down Expand Up @@ -433,9 +425,6 @@ void LargeValueVisitor::visitApply(ApplySite applySite) {
}

static bool isMethodInstUnmodifiable(MethodInst *instr) {
if (dyn_cast<ClassMethodInst>(instr)) {
return true;
}
for (auto *user : instr->getUses()) {
if (ApplySite::isa(user->getUser())) {
ApplySite applySite = ApplySite(user->getUser());
Expand All @@ -447,10 +436,6 @@ static bool isMethodInstUnmodifiable(MethodInst *instr) {
SILFunctionTypeRepresentation::CFunctionPointer) {
return true;
}
if (applySite.getSubstCalleeType()->getRepresentation() ==
SILFunctionTypeRepresentation::Method) {
return true;
}
}
}
return false;
Expand Down
6 changes: 3 additions & 3 deletions test/IRGen/indirect_argument.sil
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,7 @@ 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-64: call swiftcc void @huge_method(%T17indirect_argument4HugeV* noalias nocapture dereferenceable({{.*}})
// CHECK-32: call swiftcc void @huge_method(%T17indirect_argument4HugeV* noalias nocapture swiftself dereferenceable({{.*}})
// CHECK: call swiftcc void @huge_method(%T17indirect_argument4HugeV* noalias nocapture swiftself dereferenceable({{.*}})
sil @huge_method : $@convention(method) Huge -> () {
entry(%x : $Huge):
%f = function_ref @huge_method : $@convention(method) Huge -> ()
Expand Down Expand Up @@ -61,7 +60,8 @@ 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: [[CLOSURE:%.*]] = call noalias %swift.refcounted* @swift_rt_swift_allocObject
// CHECK-32: [[CLOSURE:%.*]] = call noalias %swift.refcounted* @swift_rt_swift_allocObject
// CHECK-64: [[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]])
Expand Down