Reductions combine collections of input values with an associative and often commutative operator to produce collections of results. When the same input value contributes to multiple outputs, there is an opportunity to reuse partial results, enabling reduction simplification. Simplification often produces a program with lower asymptotic complexity. Typical compiler optimizations yield, at best, a constant fold speedup, but a complexity improvement from, say, cubic to quadratic complexity yields unbounded speedup for sufficiently large problems. It is well known that reductions in polyhedral programs may be simplified automatically, but previous methods cannot exploit all available reuse. This paper resolves this long-standing open problem, thereby attaining minimal asymptotic complexity in the simplified program. We propose extensions to prior work on simplification to support any independent commutative reduction. At the heart of our approach is piece-wise simplification, the notion that we can split an arbitrary reduction into pieces and then independently simplify each piece. However, the difficulty of using such piece-wise transformations is that they typically involve an infinite number of choices. We give constructive proofs to deal with this and select a finite number of pieces for simplification.
翻译:归约通过结合性与通常可交换的运算符将输入值集合组合产生结果集合。当同一输入值贡献于多个输出时,便存在重用中间结果以实现归约简化的机会。简化通常能生成具有更低渐近复杂度的程序。典型的编译器优化最多只能实现常数倍的加速,而复杂度改进(例如从立方复杂度降至平方复杂度)能为足够大规模的问题带来无界的加速效果。众所周知,多面体程序中的归约可被自动简化,但现有方法无法充分利用所有可用的重用机会。本文解决了这一长期存在的开放性问题,从而在简化程序中实现了最小的渐近复杂度。我们扩展了先前的简化研究工作,以支持任意独立的可交换归约。我们方法的核心是分段简化——即可以将任意归约拆分为多个片段,然后独立简化每个片段。然而,使用此类分段变换的难点在于它们通常涉及无限种选择。我们通过构造性证明来处理这一问题,并选取有限数量的片段进行简化。