This paper presents the shape optimization of magnet and flux barriers in the interior permanent magnet synchronous motor (IPMSM). Authors use the polygon model method with genetic programming (GP) by the twodimensional finite element method (2D-FEM). In this method, the analysis model of IPMSM is regarded as a tree structure. This method optimizes a shape by operating tree structures with GP. The tree structure of this method is possible to express every shape. Therefore, this method can obtain an optimal shape without being bound by a stereotype. The purpose is the investigation of shape design of magnet and flux barriers to improve the electromagnetic characteristics. Additionally, authors take into consideration about complexity of shape and volume of magnet.