File tree Expand file tree Collapse file tree 1 file changed +10
-7
lines changed Expand file tree Collapse file tree 1 file changed +10
-7
lines changed Original file line number Diff line number Diff line change @@ -48,13 +48,16 @@ bool SILLoop::canDuplicate(SILInstruction *I) const {
48
48
return true ;
49
49
}
50
50
if (I->isDeallocatingStack ()) {
51
- SILInstruction *Alloc = nullptr ;
52
- if (auto *Dealloc = dyn_cast<DeallocStackInst>(I))
53
- Alloc = dyn_cast<AllocStackInst>(Dealloc->getOperand ());
54
- if (auto *Dealloc = dyn_cast<DeallocRefInst>(I))
55
- Alloc = dyn_cast<AllocRefInst>(Dealloc->getOperand ());
56
- // The matching alloc_stack must be in the loop.
57
- return Alloc && contains (Alloc);
51
+ SILInstruction *alloc = nullptr ;
52
+ if (auto *dealloc = dyn_cast<DeallocStackInst>(I)) {
53
+ SILValue address = dealloc->getOperand ();
54
+ if (isa<AllocStackInst>(address) || isa<PartialApplyInst>(address))
55
+ alloc = cast<SingleValueInstruction>(address);
56
+ }
57
+ if (auto *dealloc = dyn_cast<DeallocRefInst>(I))
58
+ alloc = dyn_cast<AllocRefInst>(dealloc->getOperand ());
59
+
60
+ return alloc && contains (alloc);
58
61
}
59
62
60
63
// CodeGen can't build ssa for objc methods.
You can’t perform that action at this time.
0 commit comments