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.
ITERATION SPACES IN COMPILER 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 ITERATION SPACES IN COMPILER 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
 
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
 

Similar to ITERATION SPACES IN COMPILER 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
 
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
 
CNN.pptx
CNN.pptxCNN.pptx
CNN.pptx
 
1619 quantum computing
1619 quantum computing1619 quantum computing
1619 quantum computing
 
Bachelor's Thesis
Bachelor's ThesisBachelor's Thesis
Bachelor's Thesis
 
Calculus I basic concepts
Calculus I basic conceptsCalculus I basic concepts
Calculus I basic concepts
 

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

Open Source Camp Kubernetes 2024 | Running WebAssembly on Kubernetes by Alex ...
Open Source Camp Kubernetes 2024 | Running WebAssembly on Kubernetes by Alex ...Open Source Camp Kubernetes 2024 | Running WebAssembly on Kubernetes by Alex ...
Open Source Camp Kubernetes 2024 | Running WebAssembly on Kubernetes by Alex ...NETWAYS
 
Microsoft Copilot AI for Everyone - created by AI
Microsoft Copilot AI for Everyone - created by AIMicrosoft Copilot AI for Everyone - created by AI
Microsoft Copilot AI for Everyone - created by AITatiana Gurgel
 
Call Girls in Rohini Delhi 💯Call Us 🔝8264348440🔝
Call Girls in Rohini Delhi 💯Call Us 🔝8264348440🔝Call Girls in Rohini Delhi 💯Call Us 🔝8264348440🔝
Call Girls in Rohini Delhi 💯Call Us 🔝8264348440🔝soniya singh
 
NATIONAL ANTHEMS OF AFRICA (National Anthems of Africa)
NATIONAL ANTHEMS OF AFRICA (National Anthems of Africa)NATIONAL ANTHEMS OF AFRICA (National Anthems of Africa)
NATIONAL ANTHEMS OF AFRICA (National Anthems of Africa)Basil Achie
 
Navi Mumbai Call Girls Service Pooja 9892124323 Real Russian Girls Looking Mo...
Navi Mumbai Call Girls Service Pooja 9892124323 Real Russian Girls Looking Mo...Navi Mumbai Call Girls Service Pooja 9892124323 Real Russian Girls Looking Mo...
Navi Mumbai Call Girls Service Pooja 9892124323 Real Russian Girls Looking Mo...Pooja Nehwal
 
Open Source Strategy in Logistics 2015_Henrik Hankedvz-d-nl-log-conference.pdf
Open Source Strategy in Logistics 2015_Henrik Hankedvz-d-nl-log-conference.pdfOpen Source Strategy in Logistics 2015_Henrik Hankedvz-d-nl-log-conference.pdf
Open Source Strategy in Logistics 2015_Henrik Hankedvz-d-nl-log-conference.pdfhenrik385807
 
Philippine History cavite Mutiny Report.ppt
Philippine History cavite Mutiny Report.pptPhilippine History cavite Mutiny Report.ppt
Philippine History cavite Mutiny Report.pptssuser319dad
 
Genesis part 2 Isaiah Scudder 04-24-2024.pptx
Genesis part 2 Isaiah Scudder 04-24-2024.pptxGenesis part 2 Isaiah Scudder 04-24-2024.pptx
Genesis part 2 Isaiah Scudder 04-24-2024.pptxFamilyWorshipCenterD
 
The 3rd Intl. Workshop on NL-based Software Engineering
The 3rd Intl. Workshop on NL-based Software EngineeringThe 3rd Intl. Workshop on NL-based Software Engineering
The 3rd Intl. Workshop on NL-based Software EngineeringSebastiano Panichella
 
Call Girls in Sarojini Nagar Market Delhi 💯 Call Us 🔝8264348440🔝
Call Girls in Sarojini Nagar Market Delhi 💯 Call Us 🔝8264348440🔝Call Girls in Sarojini Nagar Market Delhi 💯 Call Us 🔝8264348440🔝
Call Girls in Sarojini Nagar Market Delhi 💯 Call Us 🔝8264348440🔝soniya singh
 
OSCamp Kubernetes 2024 | SRE Challenges in Monolith to Microservices Shift at...
OSCamp Kubernetes 2024 | SRE Challenges in Monolith to Microservices Shift at...OSCamp Kubernetes 2024 | SRE Challenges in Monolith to Microservices Shift at...
OSCamp Kubernetes 2024 | SRE Challenges in Monolith to Microservices Shift at...NETWAYS
 
Work Remotely with Confluence ACE 2.pptx
Work Remotely with Confluence ACE 2.pptxWork Remotely with Confluence ACE 2.pptx
Work Remotely with Confluence ACE 2.pptxmavinoikein
 
CTAC 2024 Valencia - Sven Zoelle - Most Crucial Invest to Digitalisation_slid...
CTAC 2024 Valencia - Sven Zoelle - Most Crucial Invest to Digitalisation_slid...CTAC 2024 Valencia - Sven Zoelle - Most Crucial Invest to Digitalisation_slid...
CTAC 2024 Valencia - Sven Zoelle - Most Crucial Invest to Digitalisation_slid...henrik385807
 
WhatsApp 📞 9892124323 ✅Call Girls In Juhu ( Mumbai )
WhatsApp 📞 9892124323 ✅Call Girls In Juhu ( Mumbai )WhatsApp 📞 9892124323 ✅Call Girls In Juhu ( Mumbai )
WhatsApp 📞 9892124323 ✅Call Girls In Juhu ( Mumbai )Pooja Nehwal
 
LANDMARKS AND MONUMENTS IN NIGERIA.pptx
LANDMARKS  AND MONUMENTS IN NIGERIA.pptxLANDMARKS  AND MONUMENTS IN NIGERIA.pptx
LANDMARKS AND MONUMENTS IN NIGERIA.pptxBasil Achie
 
CTAC 2024 Valencia - Henrik Hanke - Reduce to the max - slideshare.pdf
CTAC 2024 Valencia - Henrik Hanke - Reduce to the max - slideshare.pdfCTAC 2024 Valencia - Henrik Hanke - Reduce to the max - slideshare.pdf
CTAC 2024 Valencia - Henrik Hanke - Reduce to the max - slideshare.pdfhenrik385807
 
Russian Call Girls in Kolkata Vaishnavi 🤌 8250192130 🚀 Vip Call Girls Kolkata
Russian Call Girls in Kolkata Vaishnavi 🤌  8250192130 🚀 Vip Call Girls KolkataRussian Call Girls in Kolkata Vaishnavi 🤌  8250192130 🚀 Vip Call Girls Kolkata
Russian Call Girls in Kolkata Vaishnavi 🤌 8250192130 🚀 Vip Call Girls Kolkataanamikaraghav4
 
Simulation-based Testing of Unmanned Aerial Vehicles with Aerialist
Simulation-based Testing of Unmanned Aerial Vehicles with AerialistSimulation-based Testing of Unmanned Aerial Vehicles with Aerialist
Simulation-based Testing of Unmanned Aerial Vehicles with AerialistSebastiano Panichella
 
call girls in delhi malviya nagar @9811711561@
call girls in delhi malviya nagar @9811711561@call girls in delhi malviya nagar @9811711561@
call girls in delhi malviya nagar @9811711561@vikas rana
 
Exploring protein-protein interactions by Weak Affinity Chromatography (WAC) ...
Exploring protein-protein interactions by Weak Affinity Chromatography (WAC) ...Exploring protein-protein interactions by Weak Affinity Chromatography (WAC) ...
Exploring protein-protein interactions by Weak Affinity Chromatography (WAC) ...Salam Al-Karadaghi
 

Recently uploaded (20)

Open Source Camp Kubernetes 2024 | Running WebAssembly on Kubernetes by Alex ...
Open Source Camp Kubernetes 2024 | Running WebAssembly on Kubernetes by Alex ...Open Source Camp Kubernetes 2024 | Running WebAssembly on Kubernetes by Alex ...
Open Source Camp Kubernetes 2024 | Running WebAssembly on Kubernetes by Alex ...
 
Microsoft Copilot AI for Everyone - created by AI
Microsoft Copilot AI for Everyone - created by AIMicrosoft Copilot AI for Everyone - created by AI
Microsoft Copilot AI for Everyone - created by AI
 
Call Girls in Rohini Delhi 💯Call Us 🔝8264348440🔝
Call Girls in Rohini Delhi 💯Call Us 🔝8264348440🔝Call Girls in Rohini Delhi 💯Call Us 🔝8264348440🔝
Call Girls in Rohini Delhi 💯Call Us 🔝8264348440🔝
 
NATIONAL ANTHEMS OF AFRICA (National Anthems of Africa)
NATIONAL ANTHEMS OF AFRICA (National Anthems of Africa)NATIONAL ANTHEMS OF AFRICA (National Anthems of Africa)
NATIONAL ANTHEMS OF AFRICA (National Anthems of Africa)
 
Navi Mumbai Call Girls Service Pooja 9892124323 Real Russian Girls Looking Mo...
Navi Mumbai Call Girls Service Pooja 9892124323 Real Russian Girls Looking Mo...Navi Mumbai Call Girls Service Pooja 9892124323 Real Russian Girls Looking Mo...
Navi Mumbai Call Girls Service Pooja 9892124323 Real Russian Girls Looking Mo...
 
Open Source Strategy in Logistics 2015_Henrik Hankedvz-d-nl-log-conference.pdf
Open Source Strategy in Logistics 2015_Henrik Hankedvz-d-nl-log-conference.pdfOpen Source Strategy in Logistics 2015_Henrik Hankedvz-d-nl-log-conference.pdf
Open Source Strategy in Logistics 2015_Henrik Hankedvz-d-nl-log-conference.pdf
 
Philippine History cavite Mutiny Report.ppt
Philippine History cavite Mutiny Report.pptPhilippine History cavite Mutiny Report.ppt
Philippine History cavite Mutiny Report.ppt
 
Genesis part 2 Isaiah Scudder 04-24-2024.pptx
Genesis part 2 Isaiah Scudder 04-24-2024.pptxGenesis part 2 Isaiah Scudder 04-24-2024.pptx
Genesis part 2 Isaiah Scudder 04-24-2024.pptx
 
The 3rd Intl. Workshop on NL-based Software Engineering
The 3rd Intl. Workshop on NL-based Software EngineeringThe 3rd Intl. Workshop on NL-based Software Engineering
The 3rd Intl. Workshop on NL-based Software Engineering
 
Call Girls in Sarojini Nagar Market Delhi 💯 Call Us 🔝8264348440🔝
Call Girls in Sarojini Nagar Market Delhi 💯 Call Us 🔝8264348440🔝Call Girls in Sarojini Nagar Market Delhi 💯 Call Us 🔝8264348440🔝
Call Girls in Sarojini Nagar Market Delhi 💯 Call Us 🔝8264348440🔝
 
OSCamp Kubernetes 2024 | SRE Challenges in Monolith to Microservices Shift at...
OSCamp Kubernetes 2024 | SRE Challenges in Monolith to Microservices Shift at...OSCamp Kubernetes 2024 | SRE Challenges in Monolith to Microservices Shift at...
OSCamp Kubernetes 2024 | SRE Challenges in Monolith to Microservices Shift at...
 
Work Remotely with Confluence ACE 2.pptx
Work Remotely with Confluence ACE 2.pptxWork Remotely with Confluence ACE 2.pptx
Work Remotely with Confluence ACE 2.pptx
 
CTAC 2024 Valencia - Sven Zoelle - Most Crucial Invest to Digitalisation_slid...
CTAC 2024 Valencia - Sven Zoelle - Most Crucial Invest to Digitalisation_slid...CTAC 2024 Valencia - Sven Zoelle - Most Crucial Invest to Digitalisation_slid...
CTAC 2024 Valencia - Sven Zoelle - Most Crucial Invest to Digitalisation_slid...
 
WhatsApp 📞 9892124323 ✅Call Girls In Juhu ( Mumbai )
WhatsApp 📞 9892124323 ✅Call Girls In Juhu ( Mumbai )WhatsApp 📞 9892124323 ✅Call Girls In Juhu ( Mumbai )
WhatsApp 📞 9892124323 ✅Call Girls In Juhu ( Mumbai )
 
LANDMARKS AND MONUMENTS IN NIGERIA.pptx
LANDMARKS  AND MONUMENTS IN NIGERIA.pptxLANDMARKS  AND MONUMENTS IN NIGERIA.pptx
LANDMARKS AND MONUMENTS IN NIGERIA.pptx
 
CTAC 2024 Valencia - Henrik Hanke - Reduce to the max - slideshare.pdf
CTAC 2024 Valencia - Henrik Hanke - Reduce to the max - slideshare.pdfCTAC 2024 Valencia - Henrik Hanke - Reduce to the max - slideshare.pdf
CTAC 2024 Valencia - Henrik Hanke - Reduce to the max - slideshare.pdf
 
Russian Call Girls in Kolkata Vaishnavi 🤌 8250192130 🚀 Vip Call Girls Kolkata
Russian Call Girls in Kolkata Vaishnavi 🤌  8250192130 🚀 Vip Call Girls KolkataRussian Call Girls in Kolkata Vaishnavi 🤌  8250192130 🚀 Vip Call Girls Kolkata
Russian Call Girls in Kolkata Vaishnavi 🤌 8250192130 🚀 Vip Call Girls Kolkata
 
Simulation-based Testing of Unmanned Aerial Vehicles with Aerialist
Simulation-based Testing of Unmanned Aerial Vehicles with AerialistSimulation-based Testing of Unmanned Aerial Vehicles with Aerialist
Simulation-based Testing of Unmanned Aerial Vehicles with Aerialist
 
call girls in delhi malviya nagar @9811711561@
call girls in delhi malviya nagar @9811711561@call girls in delhi malviya nagar @9811711561@
call girls in delhi malviya nagar @9811711561@
 
Exploring protein-protein interactions by Weak Affinity Chromatography (WAC) ...
Exploring protein-protein interactions by Weak Affinity Chromatography (WAC) ...Exploring protein-protein interactions by Weak Affinity Chromatography (WAC) ...
Exploring protein-protein interactions by Weak Affinity Chromatography (WAC) ...
 

ITERATION SPACES IN COMPILER 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.