Using the Chains of Recurrences Algebra for Data Dependence Testing and Induction Variable Substitution

Using the Chains of Recurrences Algebra for Data Dependence Testing and Induction Variable Substitution

USING THE CHAINS OF RECURRENCES ALGEBRA FOR DATA DEPENDENCE TESTING AND INDUCTION VARIABLE SUBSTITUTION Name: Johnnie L. Birch Department: Department of Computer Science Major Professor: Robert A. Van Engelen Degree: Master of Science Term Degree Awarded: Fall, 2002 Optimization techniques found in today’s restructuring compilers for both single-processor and parallel architectures are often limited by ordering relationships between instructions that are determined during dependence analysis. Unfortunately, the conservative nature of these algorithms combined with an inability to effectively analyze complicated loop nestings, result in missed opportunities for identification of loop independences. This thesis examines the use of chains of recurrences (CRs) as a basis for performing induction expression recognition and loop dependence analysis. Specifically, we develop efficient algorithms for generalized induction variable substitution and non-linear dependence testing, which rely on analysis of induction variables that satisfy linear, polynomial, and geometric recurrences. THE FLORIDA STATE UNIVERSITY COLLEGE OF ARTS AND SCIENCES USING THE CHAINS OF RECURRENCES ALGEBRA FOR DATA DEPENDENCE TESTING AND INDUCTION VARIABLE SUBSTITUTION By JOHNNIE L. BIRCH A thesis submitted to the Department of Computer Science in partial fulfillment of the requirements for the degree of Master of Science Degree Awarded: Fall Semester, 2002 The members of the Committee approve the thesis of Johnnie L. Birch defended on November 22 2002. Robert A. Van Engelen Professor Directing Thesis Kyle Gallivan Committee Member David Whalley Committee Member Approved: Sudhir Aggarwal, Chair Department of Computer Science ACKNOWLEDGEMENTS I would like to thank Dr. Robert A. Van Engelen, Dr. Kyle Gallivan, Dr. David Whalley, Dr. Paul Ruscher, and Dr. Patricia Stith. iii TABLE OF CONTENTS List of Tables ................................................. vi List of Figures ................................................ vii Abstract ...................................................... ix 1. INTRODUCTION ......................................... 1 1.1 Program Optimization . 1 1.2 Research Motivation . 3 1.3 Thesis Organization . 4 2. LITERATURE REVIEW ................................... 6 2.1 Induction Variable Optimizations . 6 2.1.1 Induction Variables . 6 2.1.2 Strength Reduction . 8 2.1.3 Code Motion . 9 2.2 Induction Variable Recognition . 10 2.2.1 Cocke’s Technique . 11 2.2.2 Harrison’s Technique . 11 2.2.3 Haghighat’s and Polychronopoulos’s Technique . 12 2.3 Dependence Analysis . 13 2.3.1 Dependence Types . 13 2.3.2 Iteration Space . 14 2.3.3 Dependence Distances . 16 2.3.4 Direction Vectors . 16 2.3.5 Dependence Equations . 17 2.4 Dependence Analysis Systems . 18 2.4.1 GCD Test . 19 2.4.2 Extreme Value Test . 20 2.4.3 Fourier-Motzkin Variable Elimination . 22 2.4.4 Omega Test . 25 3. CHAINS OF RECURRENCES .............................. 26 3.1 Chains of Recurrences Notation . 26 3.2 CR Rewrite Rules . 29 iv 3.2.1 Simplification . 29 3.2.2 CR Inverse . 31 3.3 An Example of Exploitation . 31 3.3.1 Exploitation . 31 3.4 A CR Framework . 34 3.4.1 CR Implementation Representation . 34 3.4.2 The Expression Rewriting System . 36 3.4.3 A Driver . 36 4. A CHAINS OF RECURRENCES IVS ALGORITHM .......... 38 4.1 Algorithm . 38 4.1.1 Conversion to SSA form . 39 4.1.2 GIV recognition . 40 4.1.3 Induction Variable Substitution . 40 4.2 Testing the Algorithm . 42 4.2.1 TRFD . 42 4.2.2 MDG . 49 5. THE EXTREME VALUE TEST BY CR’S .................... 52 5.1 Monotonicity . 52 5.1.1 Monotonicity of CR-Expressions . 54 5.2 Algorithm . 54 5.3 Implementation . 56 5.4 Testing the Algorithm . 57 5.5 IVS integrated with EVT . 61 6. CONCLUSIONS ........................................... 65 6.1 Conclusions . 65 6.2 Future Work . 65 APPENDICES A. CONSTANT FOLDING .................................... 66 B. BOUNDS ANALYSIS ...................................... 68 REFERENCES ................................................ 72 BIOGRAPHICAL SKETCH .................................... 74 v LIST OF TABLES 2.1 Table showing direction vectors . 17 3.1 Chains of Recurrences simplification rules. 30 3.2 Chains of Recurrences inverse simplification rules. 32 A.1 Constant Folding Rules. 66 B.1 Bounds analysis rules. 68 vi LIST OF FIGURES 1.1 The results of loop induction variable substitution transforms the array access represented by the linear expression k, with a non-affine subscript i2−i expression 2 + i + j....................................... 4 2.1 Loop induction variables. 8 2.2 An example of strength reduction. 9 2.3 An example of code motion. 10 2.4 An example of data dependences in sequentially executed code. 14 2.5 An example showing loop iteration spaces. Here Graph A shows the iteration dependences for array B, while Graph B shows the iteration dependences for array D. 15 2.6 An example showing normalized loop iteration spaces. Here Graph A shows the iteration dependences for array B, while Graph B shows the iteration dependences for array D. 16 2.7 Here a 2-dimensional polytope is defined by 3 linear equations. In this example we project the polytope along the y-axis and illustrate the difference between real and dark shadows. Notice that dark shadow is a subset of the real shadow, as it corresponds to the part of the polytope at least one unit thick. 19 3.1 SUIF2 Internal Representation for the CR notation . 35 3.2 CR-Driver Main Menu . 36 3.3 CR-Driver Simplification Options Menu . 37 4.1 Pseudocode for induction variable substitution (IVS) algorithm. Here S(L) denotes the loop body, i denotes the BIV of the loop, a denotes the loop bound, and s denotes the stride of the loop. 39 4.2 Shown here is Algorithm SSA, which is responsible for converting variable assignments to SSA form. 41 4.3 Shown here is Algorithm MERGE, which is responsible for merging the sets of potential induction variables found in both the if and else part of an if-else statement. 42 vii 4.4 Shown here is Algorithm CR, which is responsible for converting variable-update pairs to CR form. 43 4.5 Shown here is Algorithm HOIST, which is responsible for removing loop induction variables and placing their closed-form outside of the loop. 44 4.6 The code segment from TRFD that we tested. 45 4.7 The code segment from MDG that we tested . 50 5.1 Shown here is Algorithm EVT, which is responsible for merging the sets of potential induction variables found in both the if and else part of an if-else statement. 55 5.2 The original loop . 57 5.3 The inner most loop is normalized. 58 5.4 Dependence testing of the innermost loop . 58 5.5 SUIF2 Internal Representation for the CR notation . 59 5.6 Dependence test in (∗, ∗) direction of array a . 60 5.7 Dependence test for (<, ∗) direction of array a. 61 5.8 Testing dependence in the (=, ∗) direction. 62 5.9 Testing for dependence in the (>, ∗) direction. 63 viii ABSTRACT Optimization techniques found in today’s restructuring compilers for both single- processor and parallel architectures are often limited by ordering relationships between instructions that are determined during dependence analysis. Unfortunately, the conservative nature of these algorithms combined with an inability to effectively analyze complicated loop nestings, result in missed opportunities for identification of loop independences. This thesis examines the use of chains of recurrences (CRs) as a basis for performing induction expression recognition and loop dependence analysis. Specifically, we.

View Full Text

Details

  • File Type
    pdf
  • Upload Time
    -
  • Content Languages
    English
  • Upload User
    Anonymous/Not logged-in
  • File Pages
    83 Page
  • File Size
    -

Download

Channel Download Status
Express Download Enable

Copyright

We respect the copyrights and intellectual property rights of all users. All uploaded documents are either original works of the uploader or authorized works of the rightful owners.

  • Not to be reproduced or distributed without explicit permission.
  • Not used for commercial purposes outside of approved use cases.
  • Not used to infringe on the rights of the original creators.
  • If you believe any content infringes your copyright, please contact us immediately.

Support

For help with questions, suggestions, or problems, please contact us