mirror of
https://github.com/apple/swift.git
synced 2025-12-21 12:14:44 +01:00
CSE: While optimizing lazy property getters, don't inline non-ossa to ossa function (#38184)
Fixes rdar://79781904
This commit is contained in:
@@ -915,6 +915,10 @@ static bool isLazyPropertyGetter(ApplyInst *ai) {
|
||||
!callee->isLazyPropertyGetter())
|
||||
return false;
|
||||
|
||||
// We cannot inline a non-ossa function into an ossa function
|
||||
if (ai->getFunction()->hasOwnership() && !callee->hasOwnership())
|
||||
return false;
|
||||
|
||||
// Only handle classes, but not structs.
|
||||
// Lazy property getters of structs have an indirect inout self parameter.
|
||||
// We don't know if the whole struct is overwritten between two getter calls.
|
||||
|
||||
Reference in New Issue
Block a user