File tree Expand file tree Collapse file tree 2 files changed +1
-17
lines changed
lib/SILOptimizer/SemanticARC Expand file tree Collapse file tree 2 files changed +1
-17
lines changed Original file line number Diff line number Diff line change @@ -251,13 +251,6 @@ bool swift::semanticarc::tryConvertOwnedPhisToGuaranteedPhis(Context &ctx) {
251
251
while (!incomingValueOperandList.empty ()) {
252
252
auto incomingValueOperand = incomingValueOperandList.pop_back_val ();
253
253
SILValue originalValue = originalIncomingValues.pop_back_val ();
254
- if (incomingValueOperand.isGuaranteedConsuming () &&
255
- isa<SILFunctionArgument>(originalValue) &&
256
- originalValue->getOwnershipKind () == OwnershipKind::Guaranteed) {
257
- auto loc = RegularLocation::getAutoGeneratedLocation ();
258
- SILBuilderWithScope builder (incomingValueOperand.getInst ());
259
- originalValue = builder.createBeginBorrow (loc, originalValue);
260
- }
261
254
incomingValueOperand.getOperand ()->set (originalValue);
262
255
}
263
256
Original file line number Diff line number Diff line change @@ -310,16 +310,7 @@ void OwnershipLiveRange::convertJoinedLiveRangePhiToGuaranteed(
310
310
InstModCallbacks callbacks) && {
311
311
312
312
// First convert the phi value itself to be guaranteed.
313
- SILValue phiValue = convertIntroducerToGuaranteed (introducer);
314
-
315
- // Then insert end_borrows at each of our destroys if we are consuming. We
316
- // have to convert the phi to guaranteed first since otherwise, the ownership
317
- // check when we create the end_borrows will trigger.
318
- if (auto *phi = dyn_cast<SILPhiArgument>(phiValue)) {
319
- if (!isGuaranteedForwardingPhi (phi)) {
320
- insertEndBorrowsAtDestroys (phiValue, deadEndBlocks, scratch);
321
- }
322
- }
313
+ convertIntroducerToGuaranteed (introducer);
323
314
324
315
// Then eliminate all of the destroys...
325
316
while (!destroyingUses.empty ()) {
You can’t perform that action at this time.
0 commit comments