| Domestic chip manufacturers developed the x86 processor chip with a relative high independent intellectual property rights.The chip is advanced in structure and good in performance,but meanwhile it relies on special system software for the best performance.Considering the open source compiler performance cannot satisfy company's requirements,while the commercial compiler incurs high royalties,Company commissioned the Institute of Computing Technology,Chinese Academy to optimize a high-performance compiler product for its application on domestic x86 machines.The GCC compiler was selected to perform as the basic platform and would be optimized by project team after market research and a series of technical demonstrations.The study focused on the compilation analysis and performance optimization,including main theoretical and technical work as the following:(1)Studied several compilation optimization theories required for this project,mainly on control flow analysis and related techniques of instruction selection optimization.Through techniques comparison and analysis,the assembly instruction performance selected by GCC compiler on control flow analysis was proved to be poor.Therefore,an optimization research on the instruction selection of the GCC compiler was conducted,in order to improve the original control flow analysis of the GCC compiler,and to enable the GCC compiler to select more efficient instructions.(2)Proposed a compilation analysis technology on domestic x86 machines.The technology included determining the target compiler optimization space,determining the optimization direction,and proposing the optimization scheme,aiming to seek the benefit source of the best performance of the target compiler,to understand why the performance were different between the target and the reference compilers,and to provide developers with suggestions on optimization directions,respectively.Compared with the traditional compilation analysis technology,this technology could significantly improve the efficiency of compilation analysis,effectively locate the optimization direction,so as to ensure the smoothprogress of the optimization work.(3)Designed and implemented the optimized compilation system based on the target GCC compiler,mainly included the GIMPLE,RTL and other important modules involving instruction selection.With the original MD file of GCC and theoretical analysis results,the compilation system realized the optimization of instruction selection,generated the desired conditional move instruction and achieved improved performance.(4)Completed the tests for the compilation optimization system.Correctness and performance tests were conducted in compiler tests.The correctness test prevented the introduction of external errors during optimization,while the performance test verified whether the compilation optimization system performs as expected. |