没有合适的资源?快使用搜索试试~ 我知道了~
首页[编译原理-鲸书]Advanced Compiler Design and Implementation
[编译原理-鲸书]Advanced Compiler Design and Implementation

steven s.muchnick具有丰富而广博的经验。他曾经是计算机科学教授,后来他将自己的知识和经验应用于编译器设计,成为两种计算机体系结构(惠普的pa-risc和sun的sparc)开发团队的核心成员,并担任这些系统的高级编译器设计与实现的领导人。他的研究和开发经验对于指导读者做出编译器设计决策极具价值
资源详情
资源评论
资源推荐

\"\"
'
,)
-)
.) .)
.)
..)
-)
, ,)
. ,II j)))

C2)
A)
Scalar
replacement
of
array
references
Data-cache
optimizations)
B)
Procedure
integration
Tail-call
optimization,
including
tail-recursion elimination
Scalar
replacement
of
aggregates
Sparse
conditional
constant
propagation
Interprocedural
constant
propagation
Procedure
specialization
and
cloning
Sparse
conditional
constant
propagation)
----------------\037)
Cl)
Global value
numbering
Local
and
global copy
propagation
Sparse
conditional
constant
propagation
Dead-code
elimination)
Constant
folding)
Algebraic
simplifications,
including
reassociation)
C3)
C)
Local
and
global
common-
subexpression
elimination
Loop-invariant
code motion)
Partial-redundancy
elimination)
C4)
Dead-code elimination
Code
hoisting
Induction-variable
strength
reduction
Linear-function test
replacement
Induction-
variable
removal
Unnecessarybounds-checking
elimination
Control-flow
optimizations)
(from
box
D))
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
codelevels
is
as follows:)
A
These
optimizations
typically
are
applied
either to source codeor
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)
In-line
expansion
Leaf-routine
optimization
Shrink
wrapping
Machine idioms
Tail
merging
Branch
optimizations
and conditional
moves
Dead-code
elimination
Software
pipelining,
with
loop
unrolling,
variable
expansion, register
renaming,
and hierarchical reduction
Basic-blockand
branch
scheduling
1
Register
allocation
by graph coloring
Basic-block and branch
scheduling
2
Intraprocedural
I-cache
optimization
Instruction
prefetching
Data
prefetching
Branch
prediction)
,)
Interprocedural register
allocation
E
Aggregation
of
global
references
Interprocedural
I-cache
optimization)
(to
constant
folding,
algebraic
simplifications,
and
reassociation)
A)
I
I
I
I
I
I
I
I
I
I
I
I
I
I
I
I
I
- - - - - - - - - - - - - - - - I)
B,
C These
optimizations
are
typically performed
on medium-
or
low-level intermediate
code,
depending
on the
overall
organization
of
the
compiler.
If
code
selectionis 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-levelcode.
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
choiceof
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 choiceof
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
assemblylanguage)
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
severalof 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
beinvoked 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
COlllpiler Design
and
Illlplelllentation)
Steven S.
Muchnick)
M\037\037@)
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
I
l/ustration Windfall
Software
Copyeditor
Jeff
Van Bueren
Proofreader
Jennifer
McClain
Indexer
Ty
Koontz
Printer
Courier
Corporation)
ACADEMICPRESS
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,
NWI
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
<9 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
/
SteveMuchnick.
p.
cm.
Includes
bibliographical
referencesand 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页未读,继续阅读
















安全验证
文档复制为VIP权益,开通VIP直接复制

评论1