[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
This commit is contained in:
Michael Gottesman
2019-11-20 14:20:18 -08:00
parent 4cd873af61
commit 5224218a1d

View File

@@ -207,7 +207,6 @@ bool ExistentialSpecializer::canSpecializeExistentialArgsInFunction(
/// Determine if this callee function can be specialized or not.
bool ExistentialSpecializer::canSpecializeCalleeFunction(FullApplySite &Apply) {
/// Determine the caller of the apply.
auto *Callee = Apply.getReferencedFunctionOrNull();
if (!Callee)
@@ -221,6 +220,13 @@ bool ExistentialSpecializer::canSpecializeCalleeFunction(FullApplySite &Apply) {
if (!Callee->isDefinition())
return false;
// If the callee has ownership enabled, bail.
//
// FIXME: We should be able to handle callees that have ownership, but the
// pass has not been updated yet.
if (Callee->hasOwnership())
return false;
/// Ignore functions with indirect results.
if (Callee->getConventions().hasIndirectSILResults())
return false;