Skip to content

Commit 5224218

Browse files
committed
[existential-specializer] Do not process callees with ownership as well as callers without ownership.
I already turned this off for callers. I just didn't do it for callees. Just an oversight. rdar://57291312
1 parent 4cd873a commit 5224218

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

lib/SILOptimizer/FunctionSignatureTransforms/ExistentialSpecializer.cpp

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -207,7 +207,6 @@ bool ExistentialSpecializer::canSpecializeExistentialArgsInFunction(
207207

208208
/// Determine if this callee function can be specialized or not.
209209
bool ExistentialSpecializer::canSpecializeCalleeFunction(FullApplySite &Apply) {
210-
211210
/// Determine the caller of the apply.
212211
auto *Callee = Apply.getReferencedFunctionOrNull();
213212
if (!Callee)
@@ -221,6 +220,13 @@ bool ExistentialSpecializer::canSpecializeCalleeFunction(FullApplySite &Apply) {
221220
if (!Callee->isDefinition())
222221
return false;
223222

223+
// If the callee has ownership enabled, bail.
224+
//
225+
// FIXME: We should be able to handle callees that have ownership, but the
226+
// pass has not been updated yet.
227+
if (Callee->hasOwnership())
228+
return false;
229+
224230
/// Ignore functions with indirect results.
225231
if (Callee->getConventions().hasIndirectSILResults())
226232
return false;

0 commit comments

Comments
 (0)