We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 716eb85 commit 0806f40Copy full SHA for 0806f40
lib/SILOptimizer/SILCombiner/SILCombinerMiscVisitors.cpp
@@ -1084,6 +1084,10 @@ SILInstruction *SILCombiner::visitReleaseValueInst(ReleaseValueInst *RVI) {
1084
SILValue Operand = RVI->getOperand();
1085
SILType OperandTy = Operand->getType();
1086
1087
+ // Do not remove a release that calls a value deinit.
1088
+ if (hasValueDeinit(OperandTy))
1089
+ return nullptr;
1090
+
1091
// Destroy value of an enum with a trivial payload or no-payload is a no-op.
1092
if (auto *EI = dyn_cast<EnumInst>(Operand)) {
1093
if (!EI->hasOperand() ||
0 commit comments