mirror of
https://github.com/apple/swift.git
synced 2025-12-21 12:14:44 +01:00
Merge pull request #64709 from meg-gupta/dcefix
Don't DCE @owned phis that may have escaped
This commit is contained in:
@@ -276,7 +276,8 @@ void DCE::markLive() {
|
||||
}
|
||||
case SILInstructionKind::DestroyValueInst: {
|
||||
auto phi = PhiValue(I.getOperand(0));
|
||||
if (phi && phi->isLexical()) {
|
||||
// Disable DCE of phis which are lexical or may have a pointer escape.
|
||||
if (phi && (phi->isLexical() || hasPointerEscape(phi))) {
|
||||
markInstructionLive(&I);
|
||||
}
|
||||
break;
|
||||
|
||||
Reference in New Issue
Block a user