message: If an instruction contains blocks, IfInst/ForInst, make sure to drop references held by those blocks when dropping references for the instruction.
diff: @@ -260,9 +260,26 @@ void Instruction::dropAllReferences() {
  for (auto &op : getInstOperands())
  op.drop();
  + switch (getKind()) {
  + case Kind::For:
  + // Make sure to drop references held by instructions within the body.
  + cast<ForInst>(this)->getBody()->dropAllReferences();
  + break;
  + case Kind::If: {
  + // Make sure to drop references held by instructions within the 'then' and
  + // 'else' blocks.
  + auto *ifInst = cast<IfInst>(this);
  + ifInst->getThen()->dropAllReferences();
  + if (auto *elseBlock = ifInst->getElse())
  + elseBlock->dropAllReferences();
  + break;
  + }
  + case Kind::OperationInst:
  if (isTerminator())
  for (auto &dest : cast<OperationInst>(this)->getBlockOperands())
  dest.drop();
  + break;
  + }
  }
  //===----------------------------------------------------------------------===//
  