With the promotion and popularity of multi-core architecture,serial code can no longer make full use of the computing resources provided by multi-core architecture,resulting in its efficiency cannot meet the needs of production.Abandoning serial software directly will waste resources,while paralleling serial code can effectively improve code performance.Compared with the method of manually paralleling the code,the use of automatic parallelization tools to parallelism the code is more efficient and less demanding,so it is necessary to develop automatic parallelization tools that can convert the code accurately and efficiently.Automatic parallelization tools generally consist of two parts: parallel determination,code optimization and generation.Parallelism judgment is the process of mining software parallelism.The parallelism speculation method is one of the more advanced methods,but its prediction accuracy and efficiency need to be improved.Code optimization and generation are parallel code generation processes,and polyhedron compilation technology is one of the representative technologies.But the existing polyhedron compiler still has shortcomings and needs to be improved.In order to improve the accuracy of speculative code parallelism and maximize the performance of reconstructed code,this paper starts from two aspects of parallelism speculative method and polyhedron compilation technology to achieve efficient and accurate automatic parallelization of code.In order to effectively improve the speculation accuracy of the parallelism speculation method,this thesis proposes a parallelism speculation method based on artificial intelligence.This method combines the LLVM(Low Level Virtual Machine)compiler and the random forest classifier to speculate on the parallelism of the code.The scop tag is used to mark the inferred parallel code,and the marked code segment is used as the input of the Pluto compiler.On this basis,the research on polyhedron compilation technology based on Pluto compiler is carried out,and an improved scheduling algorithm is proposed to improve the efficiency of the reconstruction code.Pluto compiler does not support the tile size selection method,and the loop tile size has a great impact on the performance of reconstruction code.Based on the existed research,this thesis implements a tile size selection method based on fusion model,which can effectively select the best tile size and improve the performance of the reconstruction code as much as possible.In order to verify the reliability and accuracy of the methods proposed in this thesis,a part of benchmark programs in SNU_NPB benchmark set,Polybench benchmark set and BLAS benchmark set are selected.The experimental results show that the average accuracy of the parallelism speculation method in SNU_NPB benchmark set is 90%,which is about 10% higher than the existed parallel speculation methods based on artificial intelligence.The average running time of the improved scheduling algorithm on the test benchmark sets is about 51.85% of that of pluto algorithm.When the size of the loop tile is appropriate,the efficiency of the improved scheduling algorithm can be further improved.The reconstruction code generated by the tile size selected by the loop tile size selection method is 9% faster than the reconstruction code generated by the default tile size of Pluto compiler,which shows the effectiveness of the method proposed in this thesis. |