Skip to content

Commit 29f5dad

Browse files
committed
Disable GenericSpecializer for borrow accessors in OSSA temporarily
1 parent 51c64d5 commit 29f5dad

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

lib/SILOptimizer/Transforms/GenericSpecializer.cpp

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -107,6 +107,15 @@ bool swift::specializeAppliesInFunction(SILFunction &F,
107107
if (!Callee)
108108
continue;
109109

110+
// TODO: Enable GenericSpecializer for borrow accessors in OSSA
111+
// Currently disabled since GenericSpecializer generates store_borrow to a
112+
// temporary stack location and returns a projection from the
113+
// store_borrow. This does not work for borrow accessors that return the
114+
// projection from within the store_borrow scope.
115+
if (F.hasOwnership() && Callee->getConventions().hasGuaranteedAddressResults()) {
116+
continue;
117+
}
118+
110119
FunctionBuilder.getModule().performOnceForPrespecializedImportedExtensions(
111120
[&FunctionBuilder](AbstractFunctionDecl *pre) {
112121
transferSpecializeAttributeTargets(FunctionBuilder.getModule(), FunctionBuilder,

0 commit comments

Comments
 (0)