WITH-Loop-Folding in SAC - Condensing Consecutive Array Operations

WITH-Loop-Folding in SAC - Condensing Consecutive Array Operations
复制标题

SAC 中的WITH-Loop-Folding - 压缩连续数组操作

DOI:
--
复制
发表时间:
1997
期刊:
Implementation of Functional Languages
影响因子:
--
通讯作者:
S. Scholz
S. Scholz
中科院分区:
--
文献类型:
--
作者:
S. Scholz

文献摘要

被引文献

相似文献

本文介绍了一种新的编译器优化称为循环折叠。它是基于一个特殊的循环结构,循环,在功能语言SAC(单赋值C)作为一个通用的车辆来描述数组操作的元素的基础上。一个通用的机制,这些双循环组合成一个单一的循环构造。当从高级数组规范生成高效的可执行代码时,这种机制构成了一个强大的工具。通过几个例子,它表明,即使是复杂的嵌套的数组操作类似于APL中提供的可以转换成单循环操作,这是类似于手工优化的双循环规格。因此,从原始数组操作组合复杂数组操作的方式不影响编译代码的运行时性能,即,当指定复杂的数组操作时,程序员从考虑性能的负担中解放出来。
This paper introduces a new compiler optimization called WITH-loop-folding. It is based on a special loop construct, the WITH-loop, which in the functional language SAC (for Single Assignment C) serves as a versatile vehicle to describe array operations on an element-wise basis. A general mechanism for combining two of these WITH-loops into a single loop construct is presented. This mechanism constitutes a powerful tool when it comes to generate efficiently executable code from high-level array specifications. By means of a few examples it is shown that even complex nestings of array operations similar to those available in APL can be transformed into single loop operations which are similar to hand-optimized WITH-loop specifications. As a consequence, the way a complex array operation is combined from primitive array operations does not affect the runtime performance of the compiled code, i.e., the programmer is liberated from the burden to take performance considerations into account when specifying complex array operations.