Computer Engineering & Science ›› 2022, Vol. 44 ›› Issue (12): 2111-2119.
• High Performance Computing • Previous Articles Next Articles
WANG Cui-xia,HAN Lin,LIU Hao-hao
Received:
Revised:
Accepted:
Online:
Published:
Abstract: Loop unrolling is a common compiler optimization technique, which can effectively reduce loop overhead, improve instruction-level parallelism and register locality, and improve the execution efficiency of loop. However, excessive loop unrolling will cause instruction Cache overflow and increase register pressure, and too little loop unrolling will waste potential performance improvement opportunities. Therefore, finding an appropriate unroll factor is the core of the study of loop unrolling. Based on the open-source compiler GCC, the loop unrolling problems are deeply analyzed and studied. In view of the influence of instruction Cache and register resources on the loop unrolling, a loop unrolling factor calculation method based on instruction Cache and register pressure is proposed and implemented in GCC compiler. Experiments on Sunway and Hygon platforms show that, compared with the current loop unrolling factor calculation method in GCC, this method can obtain more effective unrolling factor and improve the program performance. The average performance of the SPEC CPU 2006 is increased by 2.7% and 3.1%, respectively, and NPB-3.3.1 is increased by 5.4% and 6.1%.
Key words: compiler optimization, loop unrolling, unrolling factor, instruction Cache, register pressure
WANG Cui-xia, HAN Lin, LIU Hao-hao. Optimization of loop unrolling based on instruction Cache and register pressure[J]. Computer Engineering & Science, 2022, 44(12): 2111-2119.
0 / / Recommend
Add to citation manager EndNote|Ris|BibTeX
URL: http://joces.nudt.edu.cn/EN/
http://joces.nudt.edu.cn/EN/Y2022/V44/I12/2111