Font Size: a A A

Exploiting Some Key Techniques On The Loop Unrolling In GCC Compiler

Posted on:2016-09-19Degree:MasterType:Thesis
Country:ChinaCandidate:P ZhangFull Text:PDF
GTID:2348330536467354Subject:Computer science and technology
Abstract/Summary:PDF Full Text Request
Loop unrolling is a well-known loop transformation,and it not only can improve the performance directly,but also can enhance other optimizations.Currently,compilers employ heuristics to make decisions of loop unrolling by predicting their effects a priori.Unfortunately,due to the unpredictability of optimization interaction and the complexity of target microarchitecture,compilers may select a suboptimal unrolling decision.In order to solve this problem,commercial compilers provide directives for users to directly change unrolling decisions,but GCC compiler only provides a way of adjusting internal parameters to change unrolling decisions.In practice,it is difficult for users to decide how to set these parameters.So we expand loop unrolling directives for tuning.Combining directives with parameters,we tune benchmarks such as SPEC 2006 and NPB3.2.We find out that it is convenient for the expanded directives to control loop unrolling decisions,and can improve some programs' performance significantly.To avoid selecting a suboptimal unrolling decision due to unpredictability of optimization interaction,we introduce the low overhead iterative compilation method.A unrolling decision is firstly used to unroll a loop,and the result code are optimized by redundant elimination,reassociation and other optimizations,and finally a performance model is used to evaluate performances of current unrolling decision.We repeat the process and select the unrolling decision whose performance is the best.We use the low overhead iterative compiler to tune benchmarks such as SPEC 2006 and NPB3.2,and get better performances than manual tuning in less time.
Keywords/Search Tags:GCC, loop unrolling, directives, iterative compilation, program tuning
PDF Full Text Request
Related items