File tree Expand file tree Collapse file tree 1 file changed +2
-6
lines changed
lib/SILOptimizer/Transforms Expand file tree Collapse file tree 1 file changed +2
-6
lines changed Original file line number Diff line number Diff line change @@ -283,8 +283,8 @@ void DCE::markLive() {
283
283
}
284
284
case SILInstructionKind::EndBorrowInst: {
285
285
auto phi = PhiValue (I.getOperand (0 ));
286
- // If there is a pointer escape, disable DCE.
287
- if (phi && hasPointerEscape (phi)) {
286
+ // If there is a pointer escape or phi is lexical , disable DCE.
287
+ if (phi && ( hasPointerEscape (phi) || phi-> isLexical () )) {
288
288
markInstructionLive (&I);
289
289
}
290
290
// The instruction is live only if it's operand value is also live
@@ -320,10 +320,6 @@ void DCE::markLive() {
320
320
disableBorrowDCE (root);
321
321
}
322
322
}
323
- // If we have a lexical borrow scope, disable DCE.
324
- if (borrowInst->isLexical ()) {
325
- disableBorrowDCE (borrowInst);
326
- }
327
323
break ;
328
324
}
329
325
case SILInstructionKind::LoadBorrowInst: {
You can’t perform that action at this time.
0 commit comments