Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Path: utzoo!mnetor!seismo!rutgers!ames!pioneer!eugene From: eugene@pioneer.arpa (Eugene Miya N.) Newsgroups: comp.arch,comp.sys.nsc.32k Subject: Re: What is optimization? Message-ID: <1332@ames.UUCP> Date: Tue, 21-Apr-87 15:19:05 EST Article-I.D.: ames.1332 Posted: Tue Apr 21 15:19:05 1987 Date-Received: Wed, 22-Apr-87 04:59:20 EST References: <4190@nsc.nsc.com> <951@moscom.UUCP> <2577@intelca.UUCP> Sender: usenet@ames.UUCP Reply-To: eugene@pioneer.UUCP (Eugene Miya N.) Organization: NASA Ames Research Center, Moffett Field, Calif. Lines: 87 Xref: mnetor comp.arch:1034 comp.sys.nsc.32k:101 Okay: I have this: From: %A Samuel P. Harbison %T A Computer Architecture for the Dynamic Optimization of High-Level Language Programs %R CMU-CS-80-143 %I Computer Science Dept., Carnegie-Mellon University %D September 1980 \f3Table 2-2 Optimization Techniques\fP .TS expand center; l lw(3i). _ .ul Instruction Action _ Loop manipulations T{ Transforming loops and sets of loops into other, more efficient structures; includes \f2fusing, unrolling,\fP and \f2loop switching.\fP T} Constant folding T{ The evaluation of constant expressions at compile time, including constant-based control flow, which is often used to implement conditional compilation. T} Constant propagation T{ Analyzing the use of constants, as in reducing \f2A:=2; X:= A+4;\fP to \f2A:=2; X:=6.\fP Also can be used with control structures to provide conditional compilation features. T} CSE Elimination T{ Avoiding the reevaluation of common subexpression by saving and later retrieving the value of a previous evaluation of the same expression. T} Code motion T{ A set of techniques typified by trying to avoid recomputing an identical value in every loop iteration by moving the computation outside the loop. T} Strength reduction T{ Replacing an expensive operation by a less expensive one; e.g., by replacing T} .T& l cw(3i). \f3for \f2i\f1:=1 \f3to\fP 10 \f3do\f2 X[i]\f1:=\f2i\f1*10; .T& l lw(3i). with .T& l cw(3i). T{ \f2T\f1:=10; \f3for \f2i\f1:=1 \f3to\fP 10 \f3do begin\f2 X[i]\f1:=\f2T\f1; \f2T\f1:=\f2T\f1+10 \f3end\f1; T} .T& l lw(3i). Register allocations T{ The efficient assignment of of variables, scripts, and various intermediate values to registers to minimize memory access. T} Evaluation optimizations T{ A series of techniques including the application of commutativity to arithmetic expressions, optimizing sequences of boolean comparisons, and the propagation of unary operations to produce more efficient code. T} Access mode determination T{ Determining the most efficient addressing modes to use in accessing a value. T} Variable packing T{ Determining the most efficient allocation of variables in memory. T} Tree transformations T{ A set of miscellaneous transformations on the source program aimed at efficient code; e.g., transforming \f2A-B<0\fP to \f2A