Skip to content

Commit cbfe326

Browse files
committed
Fix StackNesting to handle move_value.
1 parent 57374e4 commit cbfe326

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

include/swift/SILOptimizer/Utils/StackNesting.h

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -160,7 +160,11 @@ class StackNesting {
160160
/// Returns the stack allocation instruction for a stack deallocation
161161
/// instruction.
162162
SILInstruction *getAllocForDealloc(SILInstruction *Dealloc) const {
163-
return Dealloc->getOperand(0)->getDefiningInstruction();
163+
SILValue op = Dealloc->getOperand(0);
164+
while (auto *mvi = dyn_cast<MoveValueInst>(op)) {
165+
op = mvi->getOperand();
166+
}
167+
return op->getDefiningInstruction();
164168
}
165169

166170
/// Insert deallocations at block boundaries.

0 commit comments

Comments
 (0)