Skip to content

Commit a4a1432

Browse files
committed
[sil-stack-promotion] Don't try to promote an already promoted allocation.
It just saves some compile time. NFC.
1 parent 812b891 commit a4a1432

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

lib/SILOptimizer/Transforms/StackPromotion.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -216,7 +216,7 @@ class StackPromoter {
216216
static bool isPromotableAllocInst(SILInstruction *I) {
217217
// Check for swift object allocation.
218218
if (auto *ARI = dyn_cast<AllocRefInst>(I)) {
219-
if (!ARI->isObjC())
219+
if (!ARI->isObjC() && !ARI->canAllocOnStack())
220220
return true;
221221
return false;
222222
}

0 commit comments

Comments
 (0)