mirror of
https://github.com/apple/swift.git
synced 2025-12-21 12:14:44 +01:00
[DCE] Destroys of live values are live.
As is done for `end_borrow`s, add a dependency from a `destroy_value`s to its operand so that it is not eliminated if its operand isn't.
This commit is contained in:
@@ -280,6 +280,8 @@ void DCE::markLive() {
|
||||
if (phi && (phi->isLexical() || hasPointerEscape(phi))) {
|
||||
markInstructionLive(&I);
|
||||
}
|
||||
// The instruction is live only if it's operand value is also live
|
||||
addReverseDependency(I.getOperand(0), &I);
|
||||
break;
|
||||
}
|
||||
case SILInstructionKind::EndBorrowInst: {
|
||||
|
||||
Reference in New Issue
Block a user