SlideShare a Scribd company logo
1 of 17
ITERATIONSPACES IN COMPILER DESIGN
BY
S.SUBHALAKSHMI
M.SC(CS)
NADAR SARASWATHI COLLEGE OF ARTSANDSCIENCE
Content:
Iteration
Constructing Iteration Spaces From Loop Nests
Execution Order For Loop Nests
Matrix Formulation Of Inequalities
Incorporation Symbolic Constants
Controlling The Order Of Execution
Changing Axes
ITERATION:
Iteration is the repetition of a process in order to
generate a sequence of outcomes.
The sequence will approach some end point or end
value.
Each repetition of the process is a single iteration, and
the outcome of each iteration is then the starting point of the next
iteration.
CONSTRUCTING ITERATION SPACES FROM LOOP NESTS:
The sort of loop nests that can be handled by the
techniques to be developed.
Each loop has a single loop index, which we can assume
is incremented by 1 at each iteration.
That assumption is without loss of generality, since if the
Incrementation is by integer c>1.
We can always replace uses of index i by uses of ci+a for
some positive or negative constant a, and then increment i by 1 in the
loop.
The bounds of the loop should be written as affine
expressions of outer loop indices.
EXECUTION ORDER FOR LOOP NESTS:
A sequential execution of a loop nest sweeps through
iterations in its iteration space in an ascending lexicographic order.
A vector i=[i0,i1,…..in] is lexicographically less than
another vector i’=[i’0,i’1,…….,i’n’], written i<i’, if and only if there
exists an m<min(n,n’) such that [i0,i1,…..im]=[i’0,i’1,……,i’m] and
im+1<i’m+1.
Note that m=0 is possible ,and in fact common.
MATRIX FORMULATION OF INEQUALITIES:
The iterations in a d-deep loop can be represented
mathematically as
{i in Zd|Bi+b >0}
Here,
1.Z, as is conventional in mathematics, represents the set of
integers-positive, negative, and zero.
2.B is a d*d integer matrix,
3.b is an integer vector of length d,
4.0 is a vector of d 0’s.
INCORPORATING SYMBOLIC CONSTANTS:
Sometimes we need to optimize a loop nest that involves
certain variables that are loop- invariant for all the loops in the nest.
We call such variables symbolic constants, but to describe
the boundaries of an iteration space.
We need to treat them as variables and create an entry for
them in the vector of loop indexes.
CONTROLLING THE ORDER OF EXECUTION:
The linear inequalities extracted from the lower and upper
bounds of a loop body define a set of iterations over a convex
polyhedron.
The representation assumes no execution ordering between
iterations within the iteration space.
The original program imposes one sequential order on the
iterations, which is the lexicographic order with respect to the loop
index variables ordered from the outermost to the innermost.
However, the iterations in the space can be executed in any
order as long as their data dependences are honored.
The problem of how we choose an ordering that honors the
data independences and optimizes for data locality and parallelism is
hard and is dealt with later starting.
PROJECTION:
The loop bounds of the outer loop index in a two-deep loop
nest by projecting the convex polyhedron representing the iteration
space onto the outer dimension of the space.
The projection of a polyhedron on a lower-dimensional
space is intuitively the shadow cast by the object onto that space.
LOOP-BOUNDS GENERATIONS:
We have defined Fourier-Motzkin elimination, the
algorithm to generate the loop bounds to iterate over a convex
polyhedron is straight forward.
We compute the loop bounds in order, from the innermost
to the outerloops.
All the inequalities involving the innermost loop index
variables are written as the variable’s lower or upper bounds.
We then project away the dimension representing the
innermost loop obtain a polyhedron with one fewer dimension.
We repeat until the bounds for all the loop index variables
are found.
CHANGING AXES:
Sweeping the iteration space horizontally and
vertically.
They are just two of the most common ways of
visiting the iteration space.
There are many other possibilities we can sweep
the iteration spaces.
Complier Design

More Related Content

What's hot

Polygon Union
Polygon UnionPolygon Union
Polygon Unionprem76
 
Graph theory - Traveling Salesman and Chinese Postman
Graph theory - Traveling Salesman and Chinese PostmanGraph theory - Traveling Salesman and Chinese Postman
Graph theory - Traveling Salesman and Chinese PostmanChristian Kehl
 
SMU MCA SEM 1 FALL 2014 ASSIGNMENTS
SMU MCA SEM 1 FALL 2014 ASSIGNMENTSSMU MCA SEM 1 FALL 2014 ASSIGNMENTS
SMU MCA SEM 1 FALL 2014 ASSIGNMENTSsolved_assignments
 
Root locus techniques
Root locus techniquesRoot locus techniques
Root locus techniquesjawaharramaya
 
Representing Graphs by Touching Domains
Representing Graphs by Touching DomainsRepresenting Graphs by Touching Domains
Representing Graphs by Touching Domainsnazlitemu
 
Chapter 5 Definite Integral Topics Review
Chapter 5 Definite Integral Topics ReviewChapter 5 Definite Integral Topics Review
Chapter 5 Definite Integral Topics ReviewSharon Henry
 

What's hot (9)

Project_Report1
Project_Report1Project_Report1
Project_Report1
 
Polygon Union
Polygon UnionPolygon Union
Polygon Union
 
Graph theory - Traveling Salesman and Chinese Postman
Graph theory - Traveling Salesman and Chinese PostmanGraph theory - Traveling Salesman and Chinese Postman
Graph theory - Traveling Salesman and Chinese Postman
 
SMU MCA SEM 1 FALL 2014 ASSIGNMENTS
SMU MCA SEM 1 FALL 2014 ASSIGNMENTSSMU MCA SEM 1 FALL 2014 ASSIGNMENTS
SMU MCA SEM 1 FALL 2014 ASSIGNMENTS
 
Shortest path algorithm
Shortest  path algorithmShortest  path algorithm
Shortest path algorithm
 
Root locus techniques
Root locus techniquesRoot locus techniques
Root locus techniques
 
Representing Graphs by Touching Domains
Representing Graphs by Touching DomainsRepresenting Graphs by Touching Domains
Representing Graphs by Touching Domains
 
Unit 1. day 6b
Unit 1. day 6bUnit 1. day 6b
Unit 1. day 6b
 
Chapter 5 Definite Integral Topics Review
Chapter 5 Definite Integral Topics ReviewChapter 5 Definite Integral Topics Review
Chapter 5 Definite Integral Topics Review
 

Similar to Complier Design

Tutorial on Markov Random Fields (MRFs) for Computer Vision Applications
Tutorial on Markov Random Fields (MRFs) for Computer Vision ApplicationsTutorial on Markov Random Fields (MRFs) for Computer Vision Applications
Tutorial on Markov Random Fields (MRFs) for Computer Vision ApplicationsAnmol Dwivedi
 
Bp150513(compiler)
Bp150513(compiler)Bp150513(compiler)
Bp150513(compiler)indhu mathi
 
machine learning.pptx
machine learning.pptxmachine learning.pptx
machine learning.pptxAbdusSadik
 
Fundamentals of Machine Learning.pptx
Fundamentals of Machine Learning.pptxFundamentals of Machine Learning.pptx
Fundamentals of Machine Learning.pptxWiamFADEL
 
Mesh Shape Editing
Mesh Shape EditingMesh Shape Editing
Mesh Shape Editingssuser24ddad
 
Ap Power Point Chpt8
Ap Power Point Chpt8Ap Power Point Chpt8
Ap Power Point Chpt8dplunkett
 
Lecture 02 internet video search
Lecture 02 internet video searchLecture 02 internet video search
Lecture 02 internet video searchzukun
 
Lossless image compression via by lifting scheme
Lossless image compression via by lifting schemeLossless image compression via by lifting scheme
Lossless image compression via by lifting schemeSubhashini Subramanian
 
Loop parallelization & pipelining
Loop parallelization & pipeliningLoop parallelization & pipelining
Loop parallelization & pipeliningjagrat123
 
머피의 머신러닝: 17장 Markov Chain and HMM
머피의 머신러닝: 17장  Markov Chain and HMM머피의 머신러닝: 17장  Markov Chain and HMM
머피의 머신러닝: 17장 Markov Chain and HMMJungkyu Lee
 
Analysis and Design of Control System using Root Locus
Analysis and Design of Control System using Root LocusAnalysis and Design of Control System using Root Locus
Analysis and Design of Control System using Root LocusSiyum Tsega Balcha
 
Nelder Mead Search Algorithm
Nelder Mead Search AlgorithmNelder Mead Search Algorithm
Nelder Mead Search AlgorithmAshish Khetan
 
Line of best fit lesson
Line of best fit lessonLine of best fit lesson
Line of best fit lessonReneeTorres11
 
Machine learning Module-2, 6th Semester Elective
Machine learning Module-2, 6th Semester ElectiveMachine learning Module-2, 6th Semester Elective
Machine learning Module-2, 6th Semester ElectiveMayuraD1
 

Similar to Complier Design (20)

Compiler Designing
Compiler DesigningCompiler Designing
Compiler Designing
 
Tutorial on Markov Random Fields (MRFs) for Computer Vision Applications
Tutorial on Markov Random Fields (MRFs) for Computer Vision ApplicationsTutorial on Markov Random Fields (MRFs) for Computer Vision Applications
Tutorial on Markov Random Fields (MRFs) for Computer Vision Applications
 
Bp150513(compiler)
Bp150513(compiler)Bp150513(compiler)
Bp150513(compiler)
 
CNN for modeling sentence
CNN for modeling sentenceCNN for modeling sentence
CNN for modeling sentence
 
machine learning.pptx
machine learning.pptxmachine learning.pptx
machine learning.pptx
 
Fundamentals of Machine Learning.pptx
Fundamentals of Machine Learning.pptxFundamentals of Machine Learning.pptx
Fundamentals of Machine Learning.pptx
 
Mesh Shape Editing
Mesh Shape EditingMesh Shape Editing
Mesh Shape Editing
 
Ap Power Point Chpt8
Ap Power Point Chpt8Ap Power Point Chpt8
Ap Power Point Chpt8
 
Lecture 02 internet video search
Lecture 02 internet video searchLecture 02 internet video search
Lecture 02 internet video search
 
Lossless image compression via by lifting scheme
Lossless image compression via by lifting schemeLossless image compression via by lifting scheme
Lossless image compression via by lifting scheme
 
Elhabian_curves10.pdf
Elhabian_curves10.pdfElhabian_curves10.pdf
Elhabian_curves10.pdf
 
Loop parallelization & pipelining
Loop parallelization & pipeliningLoop parallelization & pipelining
Loop parallelization & pipelining
 
머피의 머신러닝: 17장 Markov Chain and HMM
머피의 머신러닝: 17장  Markov Chain and HMM머피의 머신러닝: 17장  Markov Chain and HMM
머피의 머신러닝: 17장 Markov Chain and HMM
 
Unit iii update
Unit iii updateUnit iii update
Unit iii update
 
Analysis and Design of Control System using Root Locus
Analysis and Design of Control System using Root LocusAnalysis and Design of Control System using Root Locus
Analysis and Design of Control System using Root Locus
 
Nelder Mead Search Algorithm
Nelder Mead Search AlgorithmNelder Mead Search Algorithm
Nelder Mead Search Algorithm
 
Line of best fit lesson
Line of best fit lessonLine of best fit lesson
Line of best fit lesson
 
Machine learning Module-2, 6th Semester Elective
Machine learning Module-2, 6th Semester ElectiveMachine learning Module-2, 6th Semester Elective
Machine learning Module-2, 6th Semester Elective
 
CNN.pptx
CNN.pptxCNN.pptx
CNN.pptx
 
1619 quantum computing
1619 quantum computing1619 quantum computing
1619 quantum computing
 

More from Subha Selvam

More from Subha Selvam (14)

Digital image processing
Digital image processingDigital image processing
Digital image processing
 
Mobile computing
Mobile computingMobile computing
Mobile computing
 
Software engineering
Software engineeringSoftware engineering
Software engineering
 
Web programming
Web programmingWeb programming
Web programming
 
Big data
Big dataBig data
Big data
 
Data mining
Data miningData mining
Data mining
 
Operating system
Operating systemOperating system
Operating system
 
Database management
Database managementDatabase management
Database management
 
Database management
Database managementDatabase management
Database management
 
Computer network
Computer networkComputer network
Computer network
 
Mathematical foundation in cs
Mathematical foundation in csMathematical foundation in cs
Mathematical foundation in cs
 
Java
JavaJava
Java
 
Sc
ScSc
Sc
 
Ds
DsDs
Ds
 

Recently uploaded

Presentation on Engagement in Book Clubs
Presentation on Engagement in Book ClubsPresentation on Engagement in Book Clubs
Presentation on Engagement in Book Clubssamaasim06
 
Busty Desi⚡Call Girls in Sector 51 Noida Escorts >༒8448380779 Escort Service-...
Busty Desi⚡Call Girls in Sector 51 Noida Escorts >༒8448380779 Escort Service-...Busty Desi⚡Call Girls in Sector 51 Noida Escorts >༒8448380779 Escort Service-...
Busty Desi⚡Call Girls in Sector 51 Noida Escorts >༒8448380779 Escort Service-...Delhi Call girls
 
No Advance 8868886958 Chandigarh Call Girls , Indian Call Girls For Full Nigh...
No Advance 8868886958 Chandigarh Call Girls , Indian Call Girls For Full Nigh...No Advance 8868886958 Chandigarh Call Girls , Indian Call Girls For Full Nigh...
No Advance 8868886958 Chandigarh Call Girls , Indian Call Girls For Full Nigh...Sheetaleventcompany
 
The workplace ecosystem of the future 24.4.2024 Fabritius_share ii.pdf
The workplace ecosystem of the future 24.4.2024 Fabritius_share ii.pdfThe workplace ecosystem of the future 24.4.2024 Fabritius_share ii.pdf
The workplace ecosystem of the future 24.4.2024 Fabritius_share ii.pdfSenaatti-kiinteistöt
 
SaaStr Workshop Wednesday w/ Lucas Price, Yardstick
SaaStr Workshop Wednesday w/ Lucas Price, YardstickSaaStr Workshop Wednesday w/ Lucas Price, Yardstick
SaaStr Workshop Wednesday w/ Lucas Price, Yardsticksaastr
 
AWS Data Engineer Associate (DEA-C01) Exam Dumps 2024.pdf
AWS Data Engineer Associate (DEA-C01) Exam Dumps 2024.pdfAWS Data Engineer Associate (DEA-C01) Exam Dumps 2024.pdf
AWS Data Engineer Associate (DEA-C01) Exam Dumps 2024.pdfSkillCertProExams
 
Causes of poverty in France presentation.pptx
Causes of poverty in France presentation.pptxCauses of poverty in France presentation.pptx
Causes of poverty in France presentation.pptxCamilleBoulbin1
 
BDSM⚡Call Girls in Sector 97 Noida Escorts >༒8448380779 Escort Service
BDSM⚡Call Girls in Sector 97 Noida Escorts >༒8448380779 Escort ServiceBDSM⚡Call Girls in Sector 97 Noida Escorts >༒8448380779 Escort Service
BDSM⚡Call Girls in Sector 97 Noida Escorts >༒8448380779 Escort ServiceDelhi Call girls
 
If this Giant Must Walk: A Manifesto for a New Nigeria
If this Giant Must Walk: A Manifesto for a New NigeriaIf this Giant Must Walk: A Manifesto for a New Nigeria
If this Giant Must Walk: A Manifesto for a New NigeriaKayode Fayemi
 
My Presentation "In Your Hands" by Halle Bailey
My Presentation "In Your Hands" by Halle BaileyMy Presentation "In Your Hands" by Halle Bailey
My Presentation "In Your Hands" by Halle Baileyhlharris
 
lONG QUESTION ANSWER PAKISTAN STUDIES10.
lONG QUESTION ANSWER PAKISTAN STUDIES10.lONG QUESTION ANSWER PAKISTAN STUDIES10.
lONG QUESTION ANSWER PAKISTAN STUDIES10.lodhisaajjda
 
Aesthetic Colaba Mumbai Cst Call girls 📞 7738631006 Grant road Call Girls ❤️-...
Aesthetic Colaba Mumbai Cst Call girls 📞 7738631006 Grant road Call Girls ❤️-...Aesthetic Colaba Mumbai Cst Call girls 📞 7738631006 Grant road Call Girls ❤️-...
Aesthetic Colaba Mumbai Cst Call girls 📞 7738631006 Grant road Call Girls ❤️-...Pooja Nehwal
 
Introduction to Prompt Engineering (Focusing on ChatGPT)
Introduction to Prompt Engineering (Focusing on ChatGPT)Introduction to Prompt Engineering (Focusing on ChatGPT)
Introduction to Prompt Engineering (Focusing on ChatGPT)Chameera Dedduwage
 
Report Writing Webinar Training
Report Writing Webinar TrainingReport Writing Webinar Training
Report Writing Webinar TrainingKylaCullinane
 
Sector 62, Noida Call girls :8448380779 Noida Escorts | 100% verified
Sector 62, Noida Call girls :8448380779 Noida Escorts | 100% verifiedSector 62, Noida Call girls :8448380779 Noida Escorts | 100% verified
Sector 62, Noida Call girls :8448380779 Noida Escorts | 100% verifiedDelhi Call girls
 
Thirunelveli call girls Tamil escorts 7877702510
Thirunelveli call girls Tamil escorts 7877702510Thirunelveli call girls Tamil escorts 7877702510
Thirunelveli call girls Tamil escorts 7877702510Vipesco
 
Air breathing and respiratory adaptations in diver animals
Air breathing and respiratory adaptations in diver animalsAir breathing and respiratory adaptations in diver animals
Air breathing and respiratory adaptations in diver animalsaqsarehman5055
 
Dreaming Music Video Treatment _ Project & Portfolio III
Dreaming Music Video Treatment _ Project & Portfolio IIIDreaming Music Video Treatment _ Project & Portfolio III
Dreaming Music Video Treatment _ Project & Portfolio IIINhPhngng3
 
BDSM⚡Call Girls in Sector 93 Noida Escorts >༒8448380779 Escort Service
BDSM⚡Call Girls in Sector 93 Noida Escorts >༒8448380779 Escort ServiceBDSM⚡Call Girls in Sector 93 Noida Escorts >༒8448380779 Escort Service
BDSM⚡Call Girls in Sector 93 Noida Escorts >༒8448380779 Escort ServiceDelhi Call girls
 

Recently uploaded (20)

Presentation on Engagement in Book Clubs
Presentation on Engagement in Book ClubsPresentation on Engagement in Book Clubs
Presentation on Engagement in Book Clubs
 
Busty Desi⚡Call Girls in Sector 51 Noida Escorts >༒8448380779 Escort Service-...
Busty Desi⚡Call Girls in Sector 51 Noida Escorts >༒8448380779 Escort Service-...Busty Desi⚡Call Girls in Sector 51 Noida Escorts >༒8448380779 Escort Service-...
Busty Desi⚡Call Girls in Sector 51 Noida Escorts >༒8448380779 Escort Service-...
 
No Advance 8868886958 Chandigarh Call Girls , Indian Call Girls For Full Nigh...
No Advance 8868886958 Chandigarh Call Girls , Indian Call Girls For Full Nigh...No Advance 8868886958 Chandigarh Call Girls , Indian Call Girls For Full Nigh...
No Advance 8868886958 Chandigarh Call Girls , Indian Call Girls For Full Nigh...
 
The workplace ecosystem of the future 24.4.2024 Fabritius_share ii.pdf
The workplace ecosystem of the future 24.4.2024 Fabritius_share ii.pdfThe workplace ecosystem of the future 24.4.2024 Fabritius_share ii.pdf
The workplace ecosystem of the future 24.4.2024 Fabritius_share ii.pdf
 
SaaStr Workshop Wednesday w/ Lucas Price, Yardstick
SaaStr Workshop Wednesday w/ Lucas Price, YardstickSaaStr Workshop Wednesday w/ Lucas Price, Yardstick
SaaStr Workshop Wednesday w/ Lucas Price, Yardstick
 
AWS Data Engineer Associate (DEA-C01) Exam Dumps 2024.pdf
AWS Data Engineer Associate (DEA-C01) Exam Dumps 2024.pdfAWS Data Engineer Associate (DEA-C01) Exam Dumps 2024.pdf
AWS Data Engineer Associate (DEA-C01) Exam Dumps 2024.pdf
 
Causes of poverty in France presentation.pptx
Causes of poverty in France presentation.pptxCauses of poverty in France presentation.pptx
Causes of poverty in France presentation.pptx
 
BDSM⚡Call Girls in Sector 97 Noida Escorts >༒8448380779 Escort Service
BDSM⚡Call Girls in Sector 97 Noida Escorts >༒8448380779 Escort ServiceBDSM⚡Call Girls in Sector 97 Noida Escorts >༒8448380779 Escort Service
BDSM⚡Call Girls in Sector 97 Noida Escorts >༒8448380779 Escort Service
 
If this Giant Must Walk: A Manifesto for a New Nigeria
If this Giant Must Walk: A Manifesto for a New NigeriaIf this Giant Must Walk: A Manifesto for a New Nigeria
If this Giant Must Walk: A Manifesto for a New Nigeria
 
My Presentation "In Your Hands" by Halle Bailey
My Presentation "In Your Hands" by Halle BaileyMy Presentation "In Your Hands" by Halle Bailey
My Presentation "In Your Hands" by Halle Bailey
 
lONG QUESTION ANSWER PAKISTAN STUDIES10.
lONG QUESTION ANSWER PAKISTAN STUDIES10.lONG QUESTION ANSWER PAKISTAN STUDIES10.
lONG QUESTION ANSWER PAKISTAN STUDIES10.
 
ICT role in 21st century education and it's challenges.pdf
ICT role in 21st century education and it's challenges.pdfICT role in 21st century education and it's challenges.pdf
ICT role in 21st century education and it's challenges.pdf
 
Aesthetic Colaba Mumbai Cst Call girls 📞 7738631006 Grant road Call Girls ❤️-...
Aesthetic Colaba Mumbai Cst Call girls 📞 7738631006 Grant road Call Girls ❤️-...Aesthetic Colaba Mumbai Cst Call girls 📞 7738631006 Grant road Call Girls ❤️-...
Aesthetic Colaba Mumbai Cst Call girls 📞 7738631006 Grant road Call Girls ❤️-...
 
Introduction to Prompt Engineering (Focusing on ChatGPT)
Introduction to Prompt Engineering (Focusing on ChatGPT)Introduction to Prompt Engineering (Focusing on ChatGPT)
Introduction to Prompt Engineering (Focusing on ChatGPT)
 
Report Writing Webinar Training
Report Writing Webinar TrainingReport Writing Webinar Training
Report Writing Webinar Training
 
Sector 62, Noida Call girls :8448380779 Noida Escorts | 100% verified
Sector 62, Noida Call girls :8448380779 Noida Escorts | 100% verifiedSector 62, Noida Call girls :8448380779 Noida Escorts | 100% verified
Sector 62, Noida Call girls :8448380779 Noida Escorts | 100% verified
 
Thirunelveli call girls Tamil escorts 7877702510
Thirunelveli call girls Tamil escorts 7877702510Thirunelveli call girls Tamil escorts 7877702510
Thirunelveli call girls Tamil escorts 7877702510
 
Air breathing and respiratory adaptations in diver animals
Air breathing and respiratory adaptations in diver animalsAir breathing and respiratory adaptations in diver animals
Air breathing and respiratory adaptations in diver animals
 
Dreaming Music Video Treatment _ Project & Portfolio III
Dreaming Music Video Treatment _ Project & Portfolio IIIDreaming Music Video Treatment _ Project & Portfolio III
Dreaming Music Video Treatment _ Project & Portfolio III
 
BDSM⚡Call Girls in Sector 93 Noida Escorts >༒8448380779 Escort Service
BDSM⚡Call Girls in Sector 93 Noida Escorts >༒8448380779 Escort ServiceBDSM⚡Call Girls in Sector 93 Noida Escorts >༒8448380779 Escort Service
BDSM⚡Call Girls in Sector 93 Noida Escorts >༒8448380779 Escort Service
 

Complier Design

  • 1. ITERATIONSPACES IN COMPILER DESIGN BY S.SUBHALAKSHMI M.SC(CS) NADAR SARASWATHI COLLEGE OF ARTSANDSCIENCE
  • 2. Content: Iteration Constructing Iteration Spaces From Loop Nests Execution Order For Loop Nests Matrix Formulation Of Inequalities Incorporation Symbolic Constants Controlling The Order Of Execution Changing Axes
  • 3. ITERATION: Iteration is the repetition of a process in order to generate a sequence of outcomes. The sequence will approach some end point or end value. Each repetition of the process is a single iteration, and the outcome of each iteration is then the starting point of the next iteration.
  • 4. CONSTRUCTING ITERATION SPACES FROM LOOP NESTS: The sort of loop nests that can be handled by the techniques to be developed. Each loop has a single loop index, which we can assume is incremented by 1 at each iteration. That assumption is without loss of generality, since if the Incrementation is by integer c>1.
  • 5. We can always replace uses of index i by uses of ci+a for some positive or negative constant a, and then increment i by 1 in the loop. The bounds of the loop should be written as affine expressions of outer loop indices.
  • 6.
  • 7. EXECUTION ORDER FOR LOOP NESTS: A sequential execution of a loop nest sweeps through iterations in its iteration space in an ascending lexicographic order. A vector i=[i0,i1,…..in] is lexicographically less than another vector i’=[i’0,i’1,…….,i’n’], written i<i’, if and only if there exists an m<min(n,n’) such that [i0,i1,…..im]=[i’0,i’1,……,i’m] and im+1<i’m+1. Note that m=0 is possible ,and in fact common.
  • 8. MATRIX FORMULATION OF INEQUALITIES: The iterations in a d-deep loop can be represented mathematically as {i in Zd|Bi+b >0} Here,
  • 9. 1.Z, as is conventional in mathematics, represents the set of integers-positive, negative, and zero. 2.B is a d*d integer matrix, 3.b is an integer vector of length d, 4.0 is a vector of d 0’s.
  • 10. INCORPORATING SYMBOLIC CONSTANTS: Sometimes we need to optimize a loop nest that involves certain variables that are loop- invariant for all the loops in the nest. We call such variables symbolic constants, but to describe the boundaries of an iteration space. We need to treat them as variables and create an entry for them in the vector of loop indexes.
  • 11. CONTROLLING THE ORDER OF EXECUTION: The linear inequalities extracted from the lower and upper bounds of a loop body define a set of iterations over a convex polyhedron. The representation assumes no execution ordering between iterations within the iteration space. The original program imposes one sequential order on the iterations, which is the lexicographic order with respect to the loop
  • 12. index variables ordered from the outermost to the innermost. However, the iterations in the space can be executed in any order as long as their data dependences are honored. The problem of how we choose an ordering that honors the data independences and optimizes for data locality and parallelism is hard and is dealt with later starting.
  • 13. PROJECTION: The loop bounds of the outer loop index in a two-deep loop nest by projecting the convex polyhedron representing the iteration space onto the outer dimension of the space. The projection of a polyhedron on a lower-dimensional space is intuitively the shadow cast by the object onto that space.
  • 14. LOOP-BOUNDS GENERATIONS: We have defined Fourier-Motzkin elimination, the algorithm to generate the loop bounds to iterate over a convex polyhedron is straight forward. We compute the loop bounds in order, from the innermost to the outerloops.
  • 15. All the inequalities involving the innermost loop index variables are written as the variable’s lower or upper bounds. We then project away the dimension representing the innermost loop obtain a polyhedron with one fewer dimension. We repeat until the bounds for all the loop index variables are found.
  • 16. CHANGING AXES: Sweeping the iteration space horizontally and vertically. They are just two of the most common ways of visiting the iteration space. There are many other possibilities we can sweep the iteration spaces.