开发者

How is a lattice used by a compiler

In my graduate class on compiler constructio开发者_Python百科n 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

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜