Engineering a Compiler, Second Edition

Keith Cooper, Linda Torczon

出版时间

2011-02-21

ISBN

9780120884780

评分

★★★★★
书籍介绍
这不是一本能让你'看完就懂'的编译原理书,而是一本逼你动手的书。相比以形式化著称的'龙书',它把重心放在编译器前端:从词法、语法到语义分析的编排清晰均衡,定义之后紧跟大量图例,读起来更友好。真正让读者记住的是它对现代编译器工程细节的扎实处理——SSA 形式的早期引入、基于 SSA 的优化、寄存器分配与指令调度,既有算法证明,也留有充分的解释空间。读者反馈普遍认为它'不拘泥细节却不缺失细节',写作节奏舒服。但多位读者坦言:浅读易,深懂难,最终仍要亲手实现才能贯通。适合已具备编程与语言基础、想系统理解现代编译器如何构建并愿意动手的人。
作者简介
Keith D. Cooper is the Doerr Professor of Computational Engineering at Rice University. He has worked on a broad collection of problems in optimization of compiled code, including inter- procedural data-flow analysis and its applications, value numbering, algebraic reassociation, register allocation, and instruction scheduling. His recent work has focused on a fundamental reexamination of the structure and behavior of traditional compilers. He has taught a variety of courses at the undergraduate level, from introductory programming through code optimization at the graduate level. He is a Fellow of the ACM. Linda Torczon, Senior Research Scientist, Department of Computer Science at Rice Uni- versity, is a principal investigator on the Platform-Aware Compilation Environment project (PACE), a DARPA-sponsored project that is developing an optimizing compiler environment which automatically adjusts its optimizations and strategies to new platforms. From 1990 to 2000, Dr. Torczon served as executive director of the Center for Research on Parallel Compu- tation (CRPC), a National Science Foundation Science and Technology Center. She also served as the executive director of HiPerSoft, of the Los Alamos Computer Science Institute, and of the Virtual Grid Application Development Software Project (VGrADS).
AI导读
核心看点
  • 均衡覆盖前端解析与后端优化
  • 深入讲解SSA形式及寄存器分配
  • 结合工程实践与算法理论
读者共识
  • 结构友好,比龙书更适合入门
  • 图解精美,解析部分讲解透彻
  • 内容扎实,是优秀的入门指南
精彩摘录
  • "当且仅当在从某过程的入口点到p处的每条代码路径上e都已经求值,且从求值处到p之间e的任何成分子表达式都没有重新定义时,表达式e在该过程位置p处是可用的。An expression e is available at point p in a procedure if and only if on every path from the procedure’s entry to p, e is evaluated and none of its constituent subexpressions is redefined between that evaluation and p."
  • "更正式地说,节点n中的定义,仅在满足下述两个条件的汇合点才需要插入相应的函数∮"
  • "第三,如果对j的某些前驱节点k,j∈DF(k),那么对每个节点l∈Dom(k),必定有j∈DF(l),除非l∈Dom(j)"
  • "就假定a0,b0,c0和d0是在进入B0时定义的。"
  • "程序设计语言应该避免二义性,二义的程序没有语义。"
  • "COMPILER CONSTRUCTION IS ENGINEERING A typical compiler has a series of passes that, together, translate code from some source language into some target language. Along the way, the compiler uses dozens of algorithms and data structures. The compiler writer must select, for each step in the process,"
  • "Formally, a finite automaton (fa) is a five-tuple (S, 6, δ, s0, SA), where 1.S is the finite set of states in the recognizer, along with an error state se. 2.6 is finite alphabet used by the recognizer. Typically, 6 is the union of the edge labels in the transition diagram. 3.δ(s,c) is the recognize"
  • "SECTION REVIEW Given a regular expression, we can derive a minimal DFA to recognize the language specified by the RE using the following steps: (1) apply Thompson's construction to build an NFA for the RE; (2) use the subset construction to derive a DFA that simulates the behavior of the RE; and (3)"
用户评论
时隔写完编译器大作业多年又读了一遍这本书,着重学习了一下之前没来得及做的SSA及基于SSA的优化,终于解决了某些困扰我多年的疑惑。 不过分拘泥于细节同时不缺失必要的细节,每段算法之后都会有很长的解释,属于我读起来很舒服的写作风格。唯一让我觉得不满的是感觉大局观有些缺失,很少有哲学层面的探讨,做优化容易陷入加速某些特定的情况,而怎样的抽象是必要的,可能需要站在更高的视角。
roadmap on compiler
看内容编排就是极扎实
难
新年第一本
关于编译器中端和后端的部分着实让人受益匪浅。
恶补基础
比着Stanford的compiler看的,果然大家公认的讲的详细的部分就是我看不懂的部分
现代编译器学习roadmap,很早就引入了SSA form好评。优化部分讲的不是特别多,不过作为入门书也够了。
下载
收藏