Skip to content

Commit 7c81340

Browse files
committed
[ForEachLoopUnroll] Fix move_value handling.
1 parent 83b9916 commit 7c81340

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

lib/SILOptimizer/LoopTransforms/ForEachLoopUnroll.cpp

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -307,7 +307,7 @@ void ArrayInfo::classifyUsesOfArray(SILValue arrayValue) {
307307
forEachCalls.insert(forEachCall);
308308
continue;
309309
}
310-
// Recursively classify begin_borrow and copy_value uses.
310+
// Recursively classify begin_borrow, copy_value, and move_value uses.
311311
if (BeginBorrowInst *beginBorrow = dyn_cast<BeginBorrowInst>(user)) {
312312
classifyUsesOfArray(beginBorrow);
313313
continue;
@@ -316,6 +316,10 @@ void ArrayInfo::classifyUsesOfArray(SILValue arrayValue) {
316316
classifyUsesOfArray(copyValue);
317317
continue;
318318
}
319+
if (MoveValueInst *moveValue = dyn_cast<MoveValueInst>(user)) {
320+
classifyUsesOfArray(moveValue);
321+
continue;
322+
}
319323
if (DestroyValueInst *destroyValue = dyn_cast<DestroyValueInst>(user)) {
320324
destroys.push_back(destroyValue);
321325
continue;

0 commit comments

Comments
 (0)