WITH-Loop-Folding in SAC - Condensing Consecutive Array Operations
WITH-Loop-Folding in SAC - Condensing Consecutive Array Operations
复制标题
SAC 中的WITH-Loop-Folding - 压缩连续数组操作
DOI:
--
复制
发表时间:
1997
期刊:
影响因子:
--
通讯作者:
S. Scholz
中科院分区:
文献类型:
--
作者:
S. Scholz
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.