论文标题

基于自动编译器的数据结构生成

Automatic Compiler-Based Data Structure Generation

论文作者

Rietveld, K. F. D., Wijshoff, H. A. G.

论文摘要

优化编译器主要具有优化控制流的功能。数据结构的优化留给了程序员,并且设计数据结构以适合目标硬件是程序员的责任。需要非常具体的数据结构来利用某些硬件功能,例如高速线线大小,地址对齐,向量宽度和内存层次结构细节。由于优化编译器不针对数据结构,因此这些功能在程序规范中明确编码。这导致了令人费解的程序,这些程序掩盖了编译器的计算本质,进而导致编译器分析技术分解并妨碍应用编译器的优化。 为了解决此问题,我们建议在不明确指定数据结构的情况下朝着计划规范。编译器将自动生成实际的数据结构和可执行代码,从此规范开始。在本文中,我们介绍了一个基于编译器的框架,以支持这种自动生成数据结构,从而使编译器超越了完全控制流的优化,还可以针对组织和访问数据的方式。作为对该框架有效性的案例研究,我们提供了应用技术在自动生成稀疏基质计算的数据结构中应用的详细描述和实验结果。我们表明,可以生成稀疏数据结构,直到现在只有手工指定,并且可以自动实例化例程和相应的数据结构,可以发现贵三个现有的稀疏代数库的实现优于实现。

Optimizing compilers are mainly equipped to optimize control flow. The optimization of data structures is left to the programmer and it is the programmer's responsibility to design the data structures to suit the target hardware. Very specific data structures are required to exploit certain hardware features, such as cache line size, address alignment, vector width, and memory hierarchy specifics. Because optimizing compilers do not target data structures, these features are explicitly encoded in program specifications. This leads to convoluted programs that obscure the essence of the computation from the compiler, in turn causing compiler analysis techniques to break down and hampering compiler optimizations from being applied. To solve this problem, we propose to move towards the specification of programs without explicitly specifying the data structure. The compiler will automatically generate actual data structures and executable code starting from this specification. In this paper, we introduce a compiler-based framework to support this automatic generation of data structures, allowing the compiler to go beyond the optimization of solely control flow and also target the way data is organized and accessed. As a case study of the effectiveness of this framework, we present a detailed description and experimental results of the application of the proposed techniques to automatically generate data structures for sparse matrix computations. We show that this way sparse data structures can be generated that were up till now only specified by hand and that automatically instantiated routines and corresponding data structures can be found that outperform implementations of three existing sparse algebra libraries.

扫码加入交流群

加入微信交流群

微信交流群二维码

扫码加入学术交流群,获取更多资源