Aggressive Loop Unrolling in a Retargetable Optimizing Compiler

Aggressive Loop Unrolling in a Retargetable Optimizing Compiler
复制标题

可重定向优化编译器中的积极循环展开

DOI:
--
复制
发表时间:
1996
期刊:
International Conference on Compiler Construction
影响因子:
--
通讯作者:
S. Jinturkar
S. Jinturkar
中科院分区:
--
文献类型:
--
作者:
J. Davidson;S. Jinturkar

文献摘要

被引文献

相似文献

一个众所周知的提高程序运行时性能的代码转换是循环展开。展开循环最明显的好处是,转换后的循环通常比原始循环需要更少的指令执行。指令执行的减少来自两个来源:执行的分支指令的数量减少,以及控制变量被修改的次数减少。此外,对于具有旨在利用并行级并行的功能的体系结构,循环展开可以暴露更高级别的并行级并行。循环展开是一种有效的代码转换,通常可以将大部分执行时间花费在循环中的程序的执行性能提高10%到30%。可能是因为循环展开的简单应用的有效性,它没有像其他代码改进(如寄存器分配或公共子表达式消除)那样得到广泛的研究。其结果是,许多编译器采用简单的循环展开算法,错过了许多提高运行时性能的机会。本文描述了如何在可重定向优化编译器中进行积极的循环展开。使用一组32个基准程序,这种更积极的方法来循环展开的有效性进行评估。结果表明,积极的循环展开可以产生额外的性能提高10%到20%,比许多生产编译器采用的简单,天真的方法。
A well-known code transformation for improving the run-time performance of a program is loop unrolling. The most obvious benefit of unrolling a loop is that the transformed loop usually requires fewer instruction executions than the original loop. The reduction in instruction executions comes from two sources: the number of branch instructions executed is reduced, and the control variable is modified fewer times. In addition, for architectures with features designed to exploit instruction-level parallelism, loop unrolling can expose greater levels of instruction-level parallelism. Loop unrolling is an effective code transformation often improving the execution performance of programs that spend much of their execution time in loops by 10 to 30 percent. Possibly because of the effectiveness of a simple application of loop unrolling, it has not been studied as extensively as other code improvements such as register allocation or common subexpression elimination. The result is that many compilers employ simplistic loop unrolling algorithms that miss many opportunities for improving run-time performance. This paper describes how aggressive loop unrolling is done in a retargetable optimizing compiler. Using a set of 32 benchmark programs, the effectiveness of this more aggressive approach to loop unrolling is evaluated. The results show that aggressive loop unrolling can yield additional performance increase of 10 to 20 percent over the simple, naive approaches employed by many production compilers.