[move-only] Update the non-address move checker part of the optimizer to handle mark_must_check on addresses.

This commit is contained in:
Michael Gottesman
2022-08-02 13:36:57 -07:00
parent 7b9d4e645c
commit 467b742a5c
10 changed files with 90 additions and 17 deletions

View File

@@ -169,6 +169,17 @@ bool GatherWritesVisitor::visitUse(Operand *op, AccessUseType useTy) {
}
return true;
case SILInstructionKind::ExplicitCopyAddrInst:
if (cast<ExplicitCopyAddrInst>(user)->getDest() == op->get()) {
writeAccumulator.push_back(op);
return true;
}
// This operand is the copy source. Check if it is taken.
if (cast<ExplicitCopyAddrInst>(user)->isTakeOfSrc()) {
writeAccumulator.push_back(op);
}
return true;
case SILInstructionKind::MarkUnresolvedMoveAddrInst:
if (cast<MarkUnresolvedMoveAddrInst>(user)->getDest() == op->get()) {
writeAccumulator.push_back(op);