arXivDaily arXiv每日学术速递 周一至周五更新
arXiv 2203.07109cs.DCcs.PL
收藏

基于数据库的数据结构自动生成

Automatic Compiler-Based Data Structure Generation

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

摘要:

优化编译器主要用于优化控制流程。数据结构的优化留给程序员,并且程序员的责任是设计数据结构以适合目标硬件。需要非常特定的数据结构来利用某些硬件功能,例如高速缓存行大小、地址对齐、向量宽度和存储层次结构细节。因为优化编译器不以数据结构为目标,所以这些特性被显式地编码在程序规范中。这会导致复杂的程序从编译器中隐藏计算的本质,从而导致编译器分析技术崩溃并阻碍编译器优化的应用。为了解决这个问题,我们建议走向规范的程序,而不明确指定的数据结构。编译器将自动生成实际的数据结构和从该规范开始的可执行代码。在本文中,我们介绍了一个基于编译器的框架,以支持这种自动生成的数据结构,使编译器超越了单独的控制流的优化,也针对数据的组织和访问的方式。作为这个框架的有效性的案例研究,我们提出了一个详细的描述和实验结果的应用所提出的技术,自动生成数据结构稀疏矩阵计算。我们表明,这种方式可以生成稀疏的数据结构,到目前为止,只有指定的手和自动实例化的例程和相应的数据结构可以发现,优于现有的三个稀疏代数库的实现。

英文摘要:

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.

机构、总结、中文摘要均由AI分析而来,可能存在错误,请以论文正文为准。

↑