CSE: While optimizing lazy property getters, don't inline non-ossa to ossa function (#38184)

Fixes rdar://79781904
This commit is contained in:
Meghana Gupta
2021-07-01 16:44:57 -07:00
committed by GitHub
parent 3ef930c0b2
commit 7a35c478b6
3 changed files with 82 additions and 0 deletions

View File

@@ -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.