Sharlit - A Tool for Building Optimizers

Sharlit - A Tool for Building Optimizers
复制标题

Sharlit - 构建优化器的工具

DOI:
10.1145/143103.143120
复制
发表时间:
1992
期刊:
影响因子:
3.3
通讯作者:
J. Hennessy
J. Hennessy
中科院分区:
生物学2区
文献类型:
--
作者:
S. Tjiang;J. Hennessy

文献摘要

被引文献

相似文献

现代编译器的一个复杂而耗时的功能是全局优化。与编译器的其他功能(如解析和代码生成)不同,优化器每次只检查一条语句或一个基本块,它的范围要大得多,一次检查和更改程序的大部分。更大的范围意味着优化器必须执行许多程序转换。这些转换中的每一个都对程序的内部表示提出了自己的特定要求;每一个都可以以不同的方式与其他转换交互并依赖于其他转换。这使得优化器变得庞大而复杂。尽管它们很复杂,但很少有工具可以帮助构建优化器。这与编译器的其他部分形成了鲜明的对比,在这些部分中,多年的经验已经在工具中达到了顶峰,可以很容易地构建这些其他部分。例如,分析器生成器用于构建前端,窥视孔优化器和树匹配器用于构建代码生成器,本文介绍了Sharlit,一个支持构建模块化和可扩展全局优化器的工具。我们将展示Sharlit如何帮助构建数据流分析器和使用数据流分析信息的转换,这两者都是任何优化器的主要组件。Sharlit是用C++实现的,它使用C++的方式与YACC使用C的方式相同。因此,我们假设读者对C++有一定的了解[9]。
A complex and time-consuming function of a modern compiler is global optimization. Unlike other functions of a compiler such as parsing and code generation which examine only one statement or one basic block at a time, optimizers are much larger in scope, examining and changing large portions of a program all at once. The larger scope means optimizers must perform many program transformations. Each of these transformations makes its own particular demands on the internal representation of programs; each can interact with and depend on the others in different ways. This makes optimizers large and complex.Despite their complexity, few tools exist to help in building optimizers. This is in stark contrast with other parts of the compiler where years of experience have culminated in tools with which these other parts can be constructed easily. For example, parser generators are used to build front-ends, and peephole optimizers and tree matchers are used to build code generators.This paper presents Sharlit, a tool to support the construction of modular and extensible global optimizers. We will show how Sharlit helps in constructing data-flow analyzers and the transformations that use data-flow analysis information, both are major components of any optimizer.Sharlit is implemented in C++ and uses C++ in the same way that YACC uses C. Thus we assume the reader has some familiarity with C++[9].