In order to investigate the effect of Mg2Si formation on the microstructure and properties of an Al−Si alloy, the critical point of a hypereutectic Al−17Si−4Cu−Mg alloy was calculated by Pandat software. The calculation results of the equilibrium phase diagram show that the critical point for Mg2Si phase formation for the alloy was obtained when the Mg content was 2.2%. The contents of 0.5 wt.% Mg and 2.5 wt.% Mg were selected as the research object. The content of Mg increased from 0.5 wt.% to 2.5 wt.%, the eutectic Si in the matrix was reduced, and the Chinese character-like Mg2Si phase appeared in the microstructure. In the peak ageing state, in addition to θ″ and Q′ phases that were mainly precipitated, there was also needle-like β″ precipitation in the 2.5 wt.% Mg content alloy. Larger precipitates were found in 2.5 wt.% content alloys, mainly due to the promotion of the solid solution having the aggregation and segregation of more solute elements in the matrix. The tensile strength, elongation, and hardness of hypereutectic Al−17Si−4Cu−0.5Mg alloy under peak ageing were 331 MPa, 3.11%, and 152.1 HB, respectively. The tensile strength and the elongation decreased while the hardness increased with the 2.5 wt.% Mg content, which is due to the formation of hard and brittle Mg2Si and Al8FeMg3Si, which has a splitting effect on the matrix.