Skip to content

Commit bdcc409

Browse files
committed
[MoveObjectChecker] same-inst checking for mark_depends
Extends checkForSameInstMultipleUseErrors to ignore irrelevant unowned uses, including the mark_dependence base operand, which is currently considered a pointer escape.
1 parent 508e676 commit bdcc409

File tree

1 file changed

+3
-6
lines changed

1 file changed

+3
-6
lines changed

lib/SILOptimizer/Mandatory/MoveOnlyObjectCheckerUtils.cpp

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -219,15 +219,12 @@ bool MoveOnlyObjectCheckerPImpl::checkForSameInstMultipleUseErrors(
219219
case OperandOwnership::NonUse:
220220
continue;
221221

222-
// Conservatively treat a conversion to an unowned value as a pointer
223-
// escape. If we see this in the SIL, fail and return false so we emit a
224-
// "compiler doesn't understand error".
225222
case OperandOwnership::ForwardingUnowned:
226223
case OperandOwnership::PointerEscape:
227224
case OperandOwnership::BitwiseEscape:
228-
LLVM_DEBUG(llvm::dbgs()
229-
<< " Found forwarding unowned or escape!\n");
230-
return false;
225+
// None of the "unowned" uses can consume the original value. Simply
226+
// ignore them.
227+
continue;
231228

232229
case OperandOwnership::TrivialUse:
233230
case OperandOwnership::InstantaneousUse:

0 commit comments

Comments
 (0)