@@ -124,9 +124,6 @@ struct DeinitBarriers final {
124124 // / Blocks to "after the end" of which hoisting was able to proceed.
125125 BasicBlockSet hoistingReachesEndBlocks;
126126
127- // / Borrows to be rewritten as borrows of %borrowee.
128- SmallVector<BeginBorrowInst *, 4 > borrows;
129-
130127 // / Copies to be rewritten as copies of %borrowee.
131128 SmallVector<CopyValueInst *, 4 > copies;
132129
@@ -153,7 +150,7 @@ class DataFlow final {
153150 Usage const &uses;
154151 DeinitBarriers &result;
155152
156- enum class Classification { Barrier, Borrow, Copy, Other };
153+ enum class Classification { Barrier, Copy, Other };
157154
158155 BackwardReachability<DataFlow> reachability;
159156
@@ -221,12 +218,7 @@ DataFlow::classifyInstruction(SILInstruction *instruction) {
221218 if (instruction == &context.introducer ) {
222219 return Classification::Barrier;
223220 }
224- if (auto *bbi = dyn_cast<BeginBorrowInst>(instruction)) {
225- if (bbi->isLexical () &&
226- isSimpleExtendedIntroducerDef (context, bbi->getOperand ())) {
227- return Classification::Borrow;
228- }
229- } else if (auto *cvi = dyn_cast<CopyValueInst>(instruction)) {
221+ if (auto *cvi = dyn_cast<CopyValueInst>(instruction)) {
230222 if (isSimpleExtendedIntroducerDef (context, cvi->getOperand ())) {
231223 return Classification::Copy;
232224 }
@@ -244,7 +236,6 @@ bool DataFlow::classificationIsBarrier(Classification classification) {
244236 switch (classification) {
245237 case Classification::Barrier:
246238 return true ;
247- case Classification::Borrow:
248239 case Classification::Copy:
249240 case Classification::Other:
250241 return false ;
@@ -259,9 +250,6 @@ void DataFlow::visitedInstruction(SILInstruction *instruction,
259250 case Classification::Barrier:
260251 result.barriers .push_back (instruction);
261252 return ;
262- case Classification::Borrow:
263- result.borrows .push_back (cast<BeginBorrowInst>(instruction));
264- return ;
265253 case Classification::Copy:
266254 result.copies .push_back (cast<CopyValueInst>(instruction));
267255 return ;
@@ -318,10 +306,6 @@ class Rewriter final {
318306bool Rewriter::run () {
319307 bool madeChange = false ;
320308
321- for (auto *bbi : barriers.borrows ) {
322- bbi->setOperand (context.borrowee );
323- madeChange = true ;
324- }
325309 for (auto *cvi : barriers.copies ) {
326310 cvi->setOperand (context.borrowee );
327311 context.modifiedCopyValueInsts .push_back (cvi);
0 commit comments