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

用语句复合剥离实现循环拟不变块运动

Loop Quasi-Invariant Chunk Motion by peeling with statement composition

Jean-Yves Moyen, Thomas Rubiano, Thomas Seiller

摘要:

编译器中使用了几种分析和转换技术。其中,剥离用于提升准不变量的循环可以用来优化生成的代码,或者简单地减轻开发人员的生活。在本文中,我们引入了一个新的概念,依赖分析借用领域的隐式计算复杂性(ICC),允许与组合语句称为块检测更多的准不变。基于WHILE语言的优化思想,我们提供了一种转换方法--重用ICC概念和技术--给编译器。这种新的分析通过构建一种新的依赖图来计算每个语句或语句块的不变性程度,找到循环的最大或最差依赖图,并识别整个块是否是准不变的。该块可以是内部循环,并且在这种情况下,可以降低整个程序的计算复杂性。我们已经在一个玩具C解析器1上实现了一个概念证明,分析和转换AST表示。在本文中,我们介绍了围绕这一概念的理论,并提出了一个原型分析通过LLVM上实现。在不久的将来,我们将实现相应的转换并提供基准比较。

英文摘要:

Several techniques for analysis and transformations are used in compilers. Among them, the peeling of loops for hoisting quasi-invariants can be used to optimize generated code, or simply ease developers' lives. In this paper, we introduce a new concept of dependency analysis borrowed from the field of Implicit Computational Complexity (ICC), allowing to work with composed statements called Chunks to detect more quasi-invariants. Based on an optimization idea given on a WHILE language, we provide a transformation method - reusing ICC concepts and techniques - to compilers. This new analysis computes an invariance degree for each statement or chunks of statements by building a new kind of dependency graph, finds the maximum or worst dependency graph for loops, and recognizes if an entire block is Quasi-Invariant or not. This block could be an inner loop, and in that case the computational complexity of the overall program can be decreased. We already implemented a proof of concept on a toy C parser 1 analysing and transforming the AST representation. In this paper, we introduce the theory around this concept and present a prototype analysis pass implemented on LLVM. In a very near future, we will implement the corresponding transformation and provide benchmarks comparisons.

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

↑