Skip to content

Commit 3277d0e

Browse files
committed
[InstUtils] Look through move as copy/cast inst.
Add move_value to the list of instructions through which getSingleValueCopyOrCast looks.
1 parent 6f22e43 commit 3277d0e

File tree

2 files changed

+3
-2
lines changed

2 files changed

+3
-2
lines changed

include/swift/SIL/InstructionUtils.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -88,8 +88,8 @@ SILValue stripBorrow(SILValue V);
8888
//===----------------------------------------------------------------------===//
8989

9090
/// Return a non-null SingleValueInstruction if the given instruction merely
91-
/// copies the value of its first operand, possibly changing its type or
92-
/// ownership state, but otherwise having no effect.
91+
/// copies or moves the value of its first operand, possibly changing its type
92+
/// or ownership state, but otherwise having no effect.
9393
///
9494
/// The returned instruction may have additional "incidental" operands;
9595
/// mark_dependence for example.

lib/SIL/Utils/InstructionUtils.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -256,6 +256,7 @@ SingleValueInstruction *swift::getSingleValueCopyOrCast(SILInstruction *I) {
256256
case SILInstructionKind::BeginBorrowInst:
257257
case SILInstructionKind::BeginAccessInst:
258258
case SILInstructionKind::MarkDependenceInst:
259+
case SILInstructionKind::MoveValueInst:
259260
return cast<SingleValueInstruction>(I);
260261
}
261262
}

0 commit comments

Comments
 (0)