Optimizing Compilers for Modern Architectures: A Dependence-Based Approach

Chapter 4: Preliminary Transformations

4.1 Introduction

Most of the dependence tests presented in Chapter 3 require that subscript expressions be linear or affine functions of loop induction variables, with known constant coefficients and at most a symbolic additive constant. If these tests are to construct an accurate dependence graph, most of the subscripts in a program must be in this form.

Unfortunately, programs are not typically written with dependence testing in mind. Programmers tend to write code that exploits the quirks of different versions of the Fortran language or its compilers. Furthermore, many idiosyncratic practices have been developed to overcome weaknesses in compiler optimization strategies. The result is often code that defeats the best dependence analyzer. The following example is typical:

    INC = 2    KI = 0    DO I = 1, 100       DO J = 1, 100          KI = KI + INC          U(KI) = U(KI) + W(J)       ENDDO       S(I)= U(KI)    ENDDO<a name="303"></a><a name="beginpage.CA977DE1-8F0B-4425-AC20-1C19E17F5661"></a>

Only two subscripts in this loop nest W(J) and S(I) are affine functions of the loop induction variables. In particular, the expression U(KI) (which is involved in every dependence test) cannot be tested in the form written because KI varies within the loop. If the tests from Chapter...

UNLIMITED FREE
ACCESS
TO THE WORLD'S BEST IDEAS

SUBMIT
Already a GlobalSpec user? Log in.

This is embarrasing...

An error occurred while processing the form. Please try again in a few minutes.

Customize Your GlobalSpec Experience

Category: Waveplates and Retardation Plates
Finish!
Privacy Policy

This is embarrasing...

An error occurred while processing the form. Please try again in a few minutes.