A comment on index register allocation

A technique is presented to reduce the enumeration required by o known procedure for optimal index register allocation in straight-line programs. This technique is based on the construction of a link diagram, which shows at any step the future occurrences of indexes which must be loaded into index registers. This diagram determines in advance the required register configuration at certain steps of the program, so that the program is subdivided into separate portions to which the allocation procedure may be applied independently. 572 Comntunications of the ACM In a recent p,'~pe:r [11, tlorwitz et al. have preser~ted a. procedure for optimal index register allocation in straight-line prog1"ams. For the present paper, it is assumed that the readers are familiar with the vew basic concepts of that procedure. The problem is approached by considering ~.he sequence of indexes called for by a program. All instructions which do not. require indexes are omitted Mm~ coasideratio~, and the above sequence is called the prowam. In the notation of ill, a star is put on those indexes which are modified by the instructions calling for them. The cost to be minimized is the number of references to core memory irl the fin.at rumfing program. The cost of a program step is 0 if the corresponding index is already present in an index register~ Otherwise, a cost 1 is required to read the index fl'om {'.ore memory, and an additional cost 1 is required if the register to be employed contains a modified (starred) index, whose present wdue must be stored back in core memory before the new index is loaded. The procedure presented in [1] has a combinatorial character, and many different allocatioI~xs must be com. pared to find the optimal one. The authors have illustrated severM rifles to strongly reduce the enumeration, and in fact it is clear that this is the cruciM point to render the algorithm of practical interest. These rules will be briefly

[1]  Richard M. Karp,et al.  Index Register Allocation , 1966, JACM.