Intelligent reflecting surface (IRS) is a promising enabler for next-generation wireless communications due to its reconfigurability and high energy efficiency in improving the propagation condition of channels. In this paper, we consider a large-scale IRS-aided multiple-input-multiple-output (MIMO) communication system in which statistical channel state information (CSI) is available at the transmitter. By leveraging random matrix theory, we first derive a deterministic approximation (DA) of the ergodic rate with low computation complexity and prove the existence and uniqueness of the DA parameters. Then, we propose an alternating optimization algorithm to obtain a locally optimal solution for maximizing the DA with respect to phase shifts and signal covariance matrices. Numerical results will show that the DA is tight and our proposed method can improve the ergodic rate effectively.