@@ -124,9 +124,6 @@ struct DeinitBarriers final {
124
124
// / Blocks to "after the end" of which hoisting was able to proceed.
125
125
BasicBlockSet hoistingReachesEndBlocks;
126
126
127
- // / Borrows to be rewritten as borrows of %borrowee.
128
- SmallVector<BeginBorrowInst *, 4 > borrows;
129
-
130
127
// / Copies to be rewritten as copies of %borrowee.
131
128
SmallVector<CopyValueInst *, 4 > copies;
132
129
@@ -153,7 +150,7 @@ class DataFlow final {
153
150
Usage const &uses;
154
151
DeinitBarriers &result;
155
152
156
- enum class Classification { Barrier, Borrow, Copy, Other };
153
+ enum class Classification { Barrier, Copy, Other };
157
154
158
155
BackwardReachability<DataFlow> reachability;
159
156
@@ -221,12 +218,7 @@ DataFlow::classifyInstruction(SILInstruction *instruction) {
221
218
if (instruction == &context.introducer ) {
222
219
return Classification::Barrier;
223
220
}
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)) {
230
222
if (isSimpleExtendedIntroducerDef (context, cvi->getOperand ())) {
231
223
return Classification::Copy;
232
224
}
@@ -244,7 +236,6 @@ bool DataFlow::classificationIsBarrier(Classification classification) {
244
236
switch (classification) {
245
237
case Classification::Barrier:
246
238
return true ;
247
- case Classification::Borrow:
248
239
case Classification::Copy:
249
240
case Classification::Other:
250
241
return false ;
@@ -259,9 +250,6 @@ void DataFlow::visitedInstruction(SILInstruction *instruction,
259
250
case Classification::Barrier:
260
251
result.barriers .push_back (instruction);
261
252
return ;
262
- case Classification::Borrow:
263
- result.borrows .push_back (cast<BeginBorrowInst>(instruction));
264
- return ;
265
253
case Classification::Copy:
266
254
result.copies .push_back (cast<CopyValueInst>(instruction));
267
255
return ;
@@ -318,10 +306,6 @@ class Rewriter final {
318
306
bool Rewriter::run () {
319
307
bool madeChange = false ;
320
308
321
- for (auto *bbi : barriers.borrows ) {
322
- bbi->setOperand (context.borrowee );
323
- madeChange = true ;
324
- }
325
309
for (auto *cvi : barriers.copies ) {
326
310
cvi->setOperand (context.borrowee );
327
311
context.modifiedCopyValueInsts .push_back (cvi);
0 commit comments