Research on Automatic SIMD Vectorization Recognization and Code Tuning Technology
- Author
- YaoYuan
- Advisor
- ZhaoRongCai
- School
- PLA Information Engineering University
- Major
- Computer Software and Theory
- Classification
- TP314 Compiler,interpreter
- Degree
- Doctoral dissertation
- Year
- 2012
- Downloads
- 38
- Citations
- 0
- SIMD automatical vectorization
- continuity analysis
- alignment analysis
- dependency analysis
- control dependence
- vector registers reuse
- interactive performance tuning
- feedback tuning
- Pragmas
Abstract
Multimedia applications usually have intensive calculation and parallel high features. Usingthe SIMD function unit and SIMD instruction set extensions, the research can enhance the speedof the multimedia program. With the complexity of multimedia programs increasingly, the SIMDmultimedia instruction set has been great expanded. And the use of SIMD extensions applicationperformance acceleration has been out of the traditional areas of multimedia, and matures into forscientific computing. Although many commercial compiler can automatically vectorizationprogram, but the code performance which generated is generally not high. There are still a lot ofdifficulties for the SIMD compiler optimization, such as reference to the structure and pointer, thedata rely on judgment and control dependent conversion seriously hindered the excavationscarried out to quantify the compiler vectorization. In order to improve the SIMD vectorizationidentification and to further explore and optimize the vectorization parallelism in the application,the thesis have developed a source to source automatic vectorization tool SW-VEC for thedomestic high-performance multi-core processors SW1600SIMD multimedia extensions. Thetool can apply serial source code analysis, optimization and reconstruction to explore the SIMDdata-parallel application and generated efficient SIMD source automatically to meet thecharacteristics of multi-core processors SW1600structure.This dissertation studies the keytechnology in building vectorization tool which the impact the vectorization identification andperformance optimization, and mainly focus on pre-optimized to vectorizaton, the SIMDdependency analysis, the SIMD parallizaton exploriton and performance optimization in variousstages of vectorization. And for the need of our project, the thesis constructed the interactionSIMD vetorization code performance tuning framework, which involved the interface design, theacquisition of feedback tuning information and the realization of compiler directive statement.The dissertation innovation is reflected in the following four aspects:1、Discussed the continuity and alignment analysis and optimization methods in thepre-optimized stage and proposed analysis and optimization methods for the continuity andalignment for structures and pointers. The existing SIMD vectorizaiton methods for the structureand pointer structures are mainly local or global array restructuring strategy, which define a newstorage structure and arrange structure or pointer to the new storage space to change its originalstorage layout structure. This approach has brought additional space and time overhead, impactgenerated vectorizaiton code performance. To this end, the dissertation proposed the method ofrearrangement of the structural members. Accoding to judge the existence of the isomorphismstatements in structure member references, the methos adjust and fill the order of structuremembers, to achieve the structure continuous and alignment analysis of transformation. For thepointer structure in the program, the thesis proposed the method of tracking and recording of thepointer reference to determine the continuous and aligned relationship. The experimental resultsshow that the structure member rearrangement and pointer for alignment analysis andoptimization method can effectively improve vectorizaton recognition rate and the performanceof generated vectorization code. Compared with local data restructuring optimization, for the core of the test program code, the structure member rearrangement optimization method get theperformance speedup from the original negative speedup increased to more than300%. Compareto the Intel compiler which appears unable to vectorize pointer code in the test program, thepointer continuity and alignment analysis optimization realized the SIMD vectorizationrecognition for pointer structure and get7%to43%speedup.2、In the SIMD data dependence anaylise, the thesis propsed the formal methods based ondata dependent distance and vectorization fator, And on this basis, the thesis propsed theanti-dependency elimanatin algorithm for the determaination ring and realized the loopdistrubition. For the control flow structure in the loop, the thesis proposed the SIMDvectorization method base on the control dependence graph. The method creates theimplementation of the array of variables according to the extended control dependence graph, andsaves the computation in the conditional expression. Using this method, not only the thesis can doSIMD automatic vectorization for the variable array assignment, but also the thesis can domulti-version vectorization for the comparation for the variable array. This method made theimpact which caused by the uncertainty of variable array to a minimum and extended the range ofvectorization recognition rate, and effectively improve the performance of the program. Theexperimental results show that the proposed SIMD dependency analysis and the optimazation andtransformation for the control flow structure analysis can effectively improve the vectorizationrecognition rate and program performance. Compared with the Intel11.0version compiler, thespeedup can improve by about35%for SW-VEC and the average speedup increases by about21%. Compared to the acceleration which not use data dependence and control dependenceanalysis and optimization proposed in the atical, SW-VEC can improve more than the highest ofabout30%and average speedup increase of about17%.3、 In the exploration of SIMD parallellism and the performance optimization tovectorization code, according to the different stages in the exploration of SIMD vectorizationparallellism, the thesis proposed the cost-benefit calculation method for loop transformation andbasic block SLP parallelism exploration and guided the choice of different options for SIMDvectorizaton exploration and performance optimization in the two-stage transformation. Aimed tothe generated vectorized code, the thesis propsed optimization method for the vector registerreuse through loop interchange and loop unrolling. The former can explore the independencybetween vector data reference and the loop index, and extract loop-independent vector calculationin the inner to the outer loop layer by loop interchange, which eliminated redundant vector loadand computing operations in the inner loop layer and improved vector register reuse. The lattercan examine and compare the relationship between loop dependence distance and thevectorazation factor and implement optimization for the whole or part of vector register reusewhen there is loop-carried flow dependence or output dependence or input dependent. In addition,to exploration the parallelism between the SIMD functional units and the scalar functional units,the thesis propose a method of mixturation of vector and scalar parallellism. This methodunrolled the loop by segmentation and changed the order of execution of the statement in the loop,which depart the statement in the loop into vectorization part and scalar part. If there are no dependencies between the two parts, these two types of statements can be executed in parallel inthe SIMD vector function units and scalar functional units, which can improve the utilization ofsystem resources. The experimental results show that the vector register reuse optimizationcombined with incoming-cost analysis can improve the performance of vecorization code. Usingthe loop segmentation unrolling algorithm, the thesis realized the vector and scalar mixingparallellzation, which effectively improve performance of the generated code. The averagespeedup is increased by about12%.4、The thesis constructed the interaction-based framework of vectorizaton code performancetuning. The framework combines three parts of the vectorization tuning window interface, staticand feedback analysis and tuning for SIMD vectorization recognition and insertion the pragmastatement. Through the framework of vectorizaton code performance tuning, the thesis can getorganic combination of generation vectorized code by static analysis and performance tuning bydynamic feedback in the vectorization code tuning window interface, in conjunction with acomplete and specification vectorization compiler directives, which can effectively improve thegenerated vectorization code performance. The experimental results show that theinteraction-based vectorizaton code performance tuning framework can effectively enhance theperformance for some of the test programs in the SPEC CPU2000test suit. The maximumperformance acceleration can increase about50%and the average speedup by the optimization isincreased by about10%.Finally, the thesis test the overall SIMD vectorization recognition rate and generatedvectorization code performance of SW-VEC tool descripted in the dissertation. The experimentalresults show that the SW-VEC automatic vectorization recognition rate is better than the Intelcompiler version11.0, and the performance speedup is about16%higer than Intel compiler. Forthe test suit of high performance application, the speedup of interactive vetorization performancetuning has been relatively close to the manual rewrite vectorization program. The averageperformance speedup can be achieved the manually rewrite code speedup of more than90%,indicating that the framework of vetorization performance tuning is good for practice.
Table of contents
Directory 4-7
table directory 7-8
LIST 8-10
Summary 10-12
ABSTRACT 12-15
first chapter 15-29
1.1 research background 15-17
1.2 research content 17-21
1.2.1 topics sources 17
1.2.2 research focus 17-21
1.3 related research 21-26
1.3.1 SIMD multimedia Extension 21-23
1.3.2 automatic vectorization method 23-24
1.3.3 SIMD compiler optimization techniques 24 -25
1.3.4 interactive parallelization techniques 25-26
1.4 the main thesis work and innovation 26-28
1.5 thesis structure 28-29
Chapter II pre-optimized SIMD vectorization technology research 29-49
2.1 SIMD vectorization pre- optimization process 29-30
2.1.1 OK candidate to quantify circulating 29-30
2.1.2 continuity and alignment of data optimization 30
2.2 continuity identification and optimization methods 30-33 <br / > 2.2.1 array access continuity discrimination method 30-31
2.2.2 continuity optimization 31-33
2.3 aligned array analysis and optimization methods 33-37
2.3.1 loop transformation 34-35
2.3.2 data conversion 35-37
2.4 structure optimization transform 37 - 42
2.4.1 structure Data recombination 38-39
2.4.2 structural rearrangement algorithm thinking 39-41
2.4.3 structure weight row algorithm description continuous and alignment analysis 41-42
2.5 pointers 42-44
2.6 test results and analysis 44-48
2.6 .1 continuous and aligned to quantify the recognition rate test before and after optimization 45-46
2.6.2 structural rearrangements performance test 46
2.6.3 pointer aligned vector identification rate test 46-48
2.7 related research and current status 48
2.8 Summary 48-49
Chapter III SIMD vectorization dependence relationship analysis and loop transformation 49-69
3.1 array data dependence analysis proposed 49-53
3.1.1 problems 49-50
3.1.2 data dependency 50-51
3.1.3 loop array data dependence analysis 51-52
3.1.4 subscript division and single subscript dependence test 52-53
extreme nbsp 3.1.5 linear affine function ; 53
3.2 relies on the distance and SIMD vectorization factor analysis to quantify the dependence 53-58
3.2.1 algorithm thinking 53-57
3.2.2 algorithm Description 57
3.2.3 Case Study 57-58
3.3 based on cyclic transformation nbsp SIMD dependency analysis ; 58-61
3.3.1 and can not be vectorized loop vectorization cycle 58-60
3.3.2 cycle distribution algorithm 60-61
3.3.3 Case Study 61
3.4 with control flow statements SIMD vectorization 61-65
3.4.1 issues raised 62-63
3.4.2 dependency graph -based control algorithm SIMD vectorization thought 63
3.4.3 algorithm Description 63-64 <br / > 3.4.4 Case Study 64-65
3.5 test results and analysis 65-67
3.6 related research and current status 67
3.7 of this chapter Summary 67-69
Chapter SIMD parallelism to identify and quantify the performance optimization 69-93
4.1 SIMD parallelism to quantify the costs of revenue 69 - proposed 75
4.1.1 problems 69-70
4.1.2 for the consideration of the income calculation program transformation 70-74
4.1.3 for basic block consideration of revenue 74-75
4.2 enhanced vector register reuse 75-86
4.2.1 vector register data reuse technology 76-78
4.2.2 cycle exchange method 78-82
4.2.3 loop unrolling pressing method 82-84
4.2.4 test Results and Analysis 84-86
4.3 vector and scalar parallel hybrid method 86-91
4.3.1 raised questions 86-87
4.3.2 aligned affect 87 -89
4.3.3 for vector and scalar parallel hybrid segment expansion algorithm 89-90
4.3.4 test Results and Analysis 90-91
4.4 related research and current status 91-92
4.5 Summary 92-93
Chapter interact vectorized code based tuning 93-115 <br / > 5.1 issues raised 93-94
5.2 interactive vectorization tuning process 94-95
5.3 to quantify the interaction tuning interface design 95 - 98
5.4 feedback tuning 98-106
5.4.1 Instrumentation and test run 99-102
5.4.2 feedback and interaction tuning 102-104
5.4.3 Case Study 104-106
5.5 to quantify pragma statement 106-110
5.5.1 for instructions statement process 107
5.5.2 to quantify pragma statement format 107-108
5.5.3 to quantify pragma statement classification 108-110 <br / > 5.6 test results and analysis 110-113
5.7 related research and current status 113-114
5.8 Summary 114-115
Chapter VI comprehensive test results and analysis 115-121
6.1 experimental platform 115
6.2 test Method 115-116
6.3 test introduced 116
6.4 test results and analysis 116-120
6.5 summary 120-121
Chapter VII Full Summary 121-123 <br / > 7.1 This work summarizes 121-122
7.2 The next step 122-123
References 123-131
Author Biography studying for a doctorate period the main work is completed 131-133
Thanks 133
Related dissertations
- Research on Profile-Guided SIMD Vectorization Identification and Optimization
- An Automatic Requirements Modeling Method Based on Relation Extraction
- A Study on Parallel Dependence Relations Decomposition of Programmable Logic Controller
- Research of Fault Diagnosis of Train for Bayesian Network
- Research and Application on Semantic Analysis of Chinese Terms
- Incorporating Dependency Analysis into Topic Modeling for Fine-grained Opinion Mining
- Improving Doo-Sabin Subdivision Scheme
- Research on Testing Technology of Object-oriented Programs Based on Dependency Analysis
- Characteristics of Functional Enzymes in Panax Notoginseng and Molecular Evolution Involved in Plant Triterpoid Biosynthesis Pathway
- Research on Dependence Analysis and Software Testing
- Study on Molecular Mechanism of the Effect of Liver Cirrhosis on Hepatocellular Carcinoma Carcinogenesis
- Research on SIMD Vectorization and Optimization of Non-Multimedia Applications
- Copula Model and Emperical Research on the Dependency of the Financial Markets
- The Dependency-based Analysis of Chinese Conjunctions and the Related Constructions
- UML Statechart Slicing Based on Dependency Analysis in the Regression Testing
- Research of Serial Program Parallelization Technology and a New Design Idea
- Automatic detection of duplicate code in the program
- Q-Learning Based Complex Program Dynamic Analysis Technology
- The Design and Implementation of Program Slicing Based on C-Similar Language
- The Research on Algorithms for Learning Bayesian Network Structures