Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[move-only] Add support for explicit_copy_addr in a few places in MemAccessUtils that I missed when introducing the instruction. #60717

Merged
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 10 additions & 0 deletions lib/SIL/Utils/MemAccessUtils.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2108,6 +2108,7 @@ bool GatherUniqueStorageUses::visitUse(Operand *use, AccessUseType useTy) {
case SILInstructionKind::InjectEnumAddrInst:
return visitor.visitStore(use);

case SILInstructionKind::ExplicitCopyAddrInst:
case SILInstructionKind::CopyAddrInst:
if (operIdx == CopyLikeInstruction::Dest) {
return visitor.visitStore(use);
Expand Down Expand Up @@ -2146,6 +2147,10 @@ bool swift::memInstMustInitialize(Operand *memOper) {
auto *CAI = cast<CopyAddrInst>(memInst);
return CAI->getDest() == address && CAI->isInitializationOfDest();
}
case SILInstructionKind::ExplicitCopyAddrInst: {
auto *CAI = cast<ExplicitCopyAddrInst>(memInst);
return CAI->getDest() == address && CAI->isInitializationOfDest();
}
case SILInstructionKind::MarkUnresolvedMoveAddrInst: {
return cast<MarkUnresolvedMoveAddrInst>(memInst)->getDest() == address;
}
Expand Down Expand Up @@ -2594,6 +2599,11 @@ void swift::visitAccessedAddress(SILInstruction *I,
visitor(&I->getAllOperands()[CopyAddrInst::Dest]);
return;

case SILInstructionKind::ExplicitCopyAddrInst:
visitor(&I->getAllOperands()[ExplicitCopyAddrInst::Src]);
visitor(&I->getAllOperands()[ExplicitCopyAddrInst::Dest]);
return;

case SILInstructionKind::MarkUnresolvedMoveAddrInst:
visitor(&I->getAllOperands()[MarkUnresolvedMoveAddrInst::Src]);
visitor(&I->getAllOperands()[MarkUnresolvedMoveAddrInst::Dest]);
Expand Down