没有合适的资源?快使用搜索试试~ 我知道了~
Advanced Compiler Design and Implementation
5星 · 超过95%的资源 需积分: 9 119 下载量 102 浏览量
2014-07-21
07:19:31
上传
评论 2
收藏 12.23MB PDF 举报
温馨提示
试读
887页
Advanced Compiler Design and Implementation
资源推荐
资源详情
资源评论
Advanced
COMPILER DESIGN
IMPLEMENTATION
Steven S. M uchnick
Order of Optimizations
This flowchart represents a recommended order for performing optimizations in an aggres
sive optimizing compiler. Other orders are possible, and the examples of real-world compilers
in Chapter 21 present several alternatives, though none of them includes all of the optimiza
tions in this diagram. The letters at the left in the diagram correspond to the levels of code
appropriate for the corresponding optimizations. The correspondence between letters and
code levels is as follows:
A These optimizations typically are applied either to source code or to a high-level intermediate
code that preserves loop structure and the sequence in which operations are performed and
that has array accesses in essentially their source-code form. Usually, these optimizations are
done very early in the compilation process, since compilation tends to lower the level of the
code as it proceeds from one phase to the next.
D
(to constant folding, algebraic
simplifications, and reassociation)
A
B, C These optimizations are typically performed on medium- or low-level intermediate code,
depending on the overall organization of the compiler. If code selection is done before all
optimizations other than those in box A (known as the “low-level” model of optimizer struc
ture), then these optimizations are performed on low-level code. If, on the other hand, some
optimizations are performed on a medium-level, relatively machine-independent intermedi
ate code and others are performed on low-level code after code generation (known as the
“mixed” model), then these optimizations are generally done on the medium-level interme
diate code.
The branches from Cl to C2 and C3 represent a choice of the method used to perform
essentially the same optimization (namely, moving computations to places where they are per
formed less frequently without changing the semantics of the program). They also represent
a choice of the data-flow analyses used to perform the optimization.
D These optimizations are almost always done on a low-level form of code—one that may
be quite machine-dependent (e.g., a structured assembly language) or that may be somewhat
more general, such as the low-level intermediate code used in this book—because they require
that addresses have been turned into the form required by the target processor and because
several of them require low-level control-flow code.
E These optimizations are performed at link time, so they operate on relocatable object code.
Three optimizations, namely, constant folding, algebraic simplification, and reassociation,
are in boxes connected to the other phases of the optimization process by dotted lines because
they are best structured as subroutines that can be invoked whenever they are needed.
A version of this diagram appears in Chapters 1 and 11 through 20 to guide the reader
in ordering optimizer components in a compiler.
Advanced Compiler Design
and Implementation
Steven S. Muchnick
MORGAN KAUFMANN PUBLISHERS
AN IMPRINT OF ACADEMIC PRESS
A Harcourt Science and Technology Company
SAN FRANCISCO SAN DIEGO NEW YORK BOSTON
LONDON SYDNEY TOKYO
Senior Editor Denise E. M. Penrose
Director of Production and Manufacturing Yonie Overton
Senior Production Editor Cheri Palmer
Editorial Coordinator Jane Elliott
Cover Design Ross Carron Design
Text Design, Composition, and Illustration Windfall Software
Copyeditor Jeff Van Bueren
Proofreader Jennifer McClain
Indexer Ty Koontz
Printer Courier Corporation
ACADEMIC PRESS
A Harcourt Science and Technology Company
525 B Street, Suite 1900, San Diego, CA 92101-4495, USA
http://www.academicpress.com
Academic Press
Harcourt Place, 32 Jamestown Road, London, NW1 7BY, United Kingdom
http://www.academicpress.com
Morgan Kaufmann Publishers
340 Pine Street, Sixth Floor, San Francisco, CA 94104-3205, USA
http://www.mkp.com
© 1997 by Academic Press
All rights reserved
Printed in the United States of America
04 03 6
No part of this publication may be reproduced, stored in a retrieval system, or transmitted
in any form or by any means—electronic, mechanical, photocopying, recording, or
otherwise—without the prior written permission of the publisher.
Library of Congress Cataloging-in-Publication Data
Muchnick, Steven S., date.
Advanced compiler design and implementation / Steve Muchnick.
p. cm.
Includes bibliographical references and index.
ISBN 1-55860-320-4
1. Compilers (Computer programs) 2. Systems programming (Computer
science). I. Title.
QA76.76.C65M8 1997
005.4'53—dc21 97-13063
CIP
剩余886页未读,继续阅读
资源评论
- zhouqixing22017-09-06书是好书,英文原版理解有点困难
- Voydomn2015-03-17鲸书,原版英文PDF
- prophet20112014-11-13高级编译知识 更加贴近现代编译器设计 龙书毕竟太老了
- GamanWu2015-08-28英文版,对现在的我有点困难
arthur_lisp
- 粉丝: 1
- 资源: 12
上传资源 快速赚钱
- 我的内容管理 展开
- 我的资源 快来上传第一个资源
- 我的收益 登录查看自己的收益
- 我的积分 登录查看自己的积分
- 我的C币 登录后查看C币余额
- 我的收藏
- 我的下载
- 下载帮助
安全验证
文档复制为VIP权益,开通VIP直接复制
信息提交成功