SideEffectAnalysis: don't assume the worst side-effects for a release instruction

Instead let the client decide what to do with this.
Sometimes the client knows what side effect a release instruction really has.
This commit is contained in:
Erik Eckstein
2018-01-04 16:11:31 -08:00
parent 8ccab3e7e4
commit db69b8d433
5 changed files with 9 additions and 5 deletions

View File

@@ -347,10 +347,6 @@ void SideEffectAnalysis::analyzeInstruction(FunctionInfo *FInfo,
case SILInstructionKind::ReleaseValueInst:
case SILInstructionKind::UnownedReleaseInst:
FInfo->FE.getEffectsOn(I->getOperand(0))->Releases = true;
// TODO: Check the call graph to be less conservative about what
// destructors might be called.
FInfo->FE.setWorstEffects();
return;
case SILInstructionKind::UnconditionalCheckedCastInst:
FInfo->FE.getEffectsOn(cast<UnconditionalCheckedCastInst>(I)->getOperand())->Reads = true;