message: Replace large identical constants with a broadcast in the XlaBuilder
  This is an optimization what is already done in the AlgebraicSimplifier
  but for large graphs that is too late. Doing it in the XlaBuilder as well
  will drastically reduce the size of the unoptimized HloProto.
diff: @@ -615,10 +615,22 @@ XlaOp XlaBuilder::TernaryOp(HloOpcode triop, const XlaOp& lhs, const XlaOp& rhs,
  XlaOp XlaBuilder::ConstantLiteral(const LiteralSlice& literal) {
  return ReportErrorOrReturn([&]() -> StatusOr<XlaOp> {
  + if (literal.shape().IsArray() && literal.element_count() > 1 &&
  + literal.IsAllFirst()) {
  + Literal scalar = LiteralUtil::GetFirstScalarLiteral(literal);
  + HloInstructionProto instr;
  + *instr.mutable_shape() = scalar.shape().ToProto();
  + *instr.mutable_literal() = scalar.ToProto();
  + TF_ASSIGN_OR_RETURN(
  + XlaOp scalar_op,
  + AddInstruction(std::move(instr), HloOpcode::kConstant));
  + return Broadcast(scalar_op, literal.shape().dimensions());
  + } else {
  HloInstructionProto instr;
  *instr.mutable_shape() = literal.shape().ToProto();
  *instr.mutable_literal() = literal.ToProto();
  return AddInstruction(std::move(instr), HloOpcode::kConstant);
  + }
  });
  }
  