摘要:
A procedure for use in an optimizing compiler termed "reassociation" determines the preferred order of combining terms in a sum so as to produce loop invariant subcomputations, or to promote common subexpressions among several essential computations, by applying the associative law of addition. To achieve this, the requisite optimization of an object program or program segment, the discrete steps of Fig. 3 must be performed after the strongly connected regions, USE and DEF chains have all been identified.
摘要:
A method for use during the optimization phase of an optimizing compiler for performing global common subexpression elimination and code motion which comprises: Determining the code basis for the object program which includes examining each basic block of code and determining the basis items on which each computation depends wherein basis items are defined as operands which are referenced in a basic block before being computed. The method next determines the "kill set" for each basis item. A kill set for one basis item is defined as the set of items comprising all non basis items which depends on the one basis item for its value. Following this UEX, DEX, and THRU are determined for each basic bloc using the previously determined basis and "kill set" information. A UEX is defined as a set of upward exposed computations, the set of computations which if executed at the beginning of a basic block give the same result as when executed in the original place in the block, wherein DEX is defined as a similar set of downward expressions and wherein THRU is defined as a set of computations which if computed at the beginning or end of the basic block give the same result. AVAIL, the set of computations whose results are valid when the basic block is entered, and INSERT, the set of computations which will be inserted at the end of the basic block, are computed from UEX, DEX, and THRU, and appropriate code insertions are made at those locations indicated by the preceding step, and finally redundant code is removed using the AVAIL set.
摘要:
@ A mechanism for performing a run-time storage ad-dress validity check within one machine cycle. The mechanism, functioning together with an intelligent compiler, eliminates the need for hardware implementation of a storage validity check. More particularly, the mechanism performs its function in one machine cycle in the event that a trap exception does not cause an interrupt. In the rare instance when an interrupt is necessary, a number of machine cycles will be impacted. The mechanism comprises a minimum amount of logic circuitry (52) for determining the trap condition operating in conjunction with conventional, previously existing compare, branch instruction testing, and interrupt generation circuitry.
摘要:
This invention provides a process within an optimising compiler for transforming code to take advantage of update instructions avaible on some computer architectures. On architectures which implement some form of autoindexing instructions or addressing modes, this process will improve the code generated for looping constructs which manipulate arrays in memory. The process is achieved by selecting memory referencing instructions inside loops for conversion to update forms, modifying those instructions to an update form avaible on a particular processor, and applying an offset compensation to other memory referencing instructions in the loop so as to enable the program to still address the appropriate locations while using the available autoindexing instructions. The improved compiler and compiler process enables the compiler to convert those program instructions that would otherwise convert to autoindexing instructions not supported by the processor to autoindexing instructions that are supported.
摘要:
The present invention relates to a method, in an optimising compiler using specified optimisation procedures for identifying ways of improving the quality of compiled code, for performing preliminary optimising procedures on a program to be compiled, prior to carrying out any specified optimisation procedure. According to the invention the preliminary optimising procedures comprise: (a) developing a control flowgraph representing all possible execution paths for the program; (b) identifying subgraphs in the program; (c) performing the steps of: (1) selecting a subgraph to be examined for the optimisation procedure, the first subgraph on a first iteration being the entire program; (2) by examining the code sequences in the subgraph, determining the number of entities in the subgraph which are relevant to each dimension of arrays used in the specified procedure to represent data flow equations; (3) determining the amount of memory required to contain the arrays; (4) if the amount of memory exceeds a predetermined memory usage limit for the compilation thereby denoting an unsuccessful attempt at the optimisation procedure, applying step (5) to the subgraph, otherwise applying the optimisation procedure to the subgraph, and (5) applying steps (2) to (4) for every subgraph contained in the subgraph for which insufficient memory was found in step (4).
摘要:
A method for performing floating point division to produce a quotient having a mantissa of n bits as well as apparatus for performing the method is based on accessing an initial guess of a reciprocal of the divisor from a table of divisor reciprocals, computing an initial estimate the quotient in a corresponding estimate from the initial estimate of the reciprocal, increasing the precision of the mantissa of the reciprocal estimate, quotient estimate, and remainder estimate by computing an error parameter and iteratively computing a current reciprocal estimate, a current quotient estimate and a current remainder estimate from the error parameter and the latest reciprocal estimate, quotient estimate and remainder estimates. Also, the step of increasing the precision is repeated until the quotient estimate and reciprocal estimate exceed n bits. Lastly, the final quotient is computed from the last current quotient estimate plus the last current reciprocal estimate times the last current remainder estimate. In this way, a quotient result is generated that is correctly rounded without conditionally testing the magnitude of the quotient.
摘要:
A method for use during the optimization phase of an optimizing compiler for performing global common subexpression elimination and code motion which comprises: Determining the code basis for the object program which includes examining each basic block of code and determining the basis items on which each computation depends wherein basis items are defined as operands which are referenced in a basic block before being computed. The method next determines the "kill set" for each basis item. A kill set for one basis item is defined as the set of items comprising all non basis items which depends on the one basis item for its value. Following this UEX, DEX, and THRU are determined for each basic bloc using the previously determined basis and "kill set" information. A UEX is defined as a set of upward exposed computations, the set of computations which if executed at the beginning of a basic block give the same result as when executed in the original place in the block, wherein DEX is defined as a similar set of downward expressions and wherein THRU is defined as a set of computations which if computed at the beginning or end of the basic block give the same result. AVAIL, the set of computations whose results are valid when the basic block is entered, and INSERT, the set of computations which will be inserted at the end of the basic block, are computed from UEX, DEX, and THRU, and appropriate code insertions are made at those locations indicated by the preceding step, and finally redundant code is removed using the AVAIL set.
摘要:
A method operable within an optimizing compiler generating Basis items and Kill Sets for use during subsequent global common subexpressions elimination and code motion procedures. More particularly, the method comprises assigning a symbolic register to each non-basis element to be computed as follows: creating a tuple (v) for each computation which is to be converted to a machine instruction by the compiler creating a table (optimally, a hash table) having an entry for all the tuples in the program being compiled; for every Basis element in a tuple being entered in the table a symbolic register uniquely assigned to that tuple is added to the Kill Set for that Basis element. For every non-basis element "n" in the tuple being entered into the table, the uniquely assigned symbolic register for that tuple is added to the Kill Sets for all the Basis elements in whose Kill Sets that non-basis element "n" appears. The symbolic register assigned to the tuple in the table is chosen to total the result of the computation of the non-basis element; and finally, a second table is constructed so that given a symbolic register, the computation which it represents can be retrieved.