编译器如何使用一个点阵 [英] How is a lattice used by a compiler

查看:82
本文介绍了编译器如何使用一个点阵的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在我的编译器构建研究生课程中,我们介绍了 lattice的概念。三个讲座一直致力于格子,到目前为止,它似乎是一个有趣的切线,但困境是它不真正帮助解释编译器如何使用一个格子来解决一个具体的问题。 p>

我们已经覆盖了解析和类型检查。我们即将开始活跃度分析和注册分配。



注意,我不是在编译编译器的资源。下面的链接列表覆盖得很好。我正在寻找的是编译器和网格之间的关系,大多数例子的奖励点的解释。





我们应该知道大部分编译器吗?

学习编写编译器

解决方案

Lattices是一个非常有用的结构,用于在正在编译的程序上进行静态分析时表示状态 - 例如。用于删除通过活性分析,可用/非常繁忙的表达式,到达定义,符号分析和常量传播检测到的死代码。



如果您想了解详细信息, :静态分析讲义


In my graduate class on compiler construction we've been introduced to the concept of a lattice. Three lectures have been devoted to lattices and so far it seems like an interesting tangent, but the dilemma is that it doesn't really help explain how a compiler uses a lattice to solve a concrete problem.

We have already covered parsing and typechecking. We're about to start liveness analysis and register allocation.

Note, I'm not looking for resources on building compilers. The following list of links have that covered pretty well. What I'm looking for is an explanation on the relationship between compilers and lattices, bonus points for the most examples.

Learning Resources on Parsers, Interpreters, and Compilers
How much of the compiler should we know?
Learning to write a compiler

解决方案

Lattices are a very useful structure to represent state while doing static analysis on the program being compiled - eg. for removing dead code detected by liveness analysis, available/very busy expressions, reaching definitions, sign analysis and constant propagation.

Here is a very good read if you want the details: Lecture Notes on Static Analysis

这篇关于编译器如何使用一个点阵的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆