SlideShare a Scribd company logo
1 of 15
GLOBAL CODE
SCHEDULING
B.SOUNDARYA ,
II M.SC(COMPUTER SCIENCE)
DEPARTMENT OF CS & IT
COMPILER DESIGN
NADAR SARASWATHI COLLEGE OF ART’S &SCIENCE
INTRODUCTION
• Definition
• Strategies
• Basic block
• Primitive code motion
• Upward code motion
• Downward code motion
• Global scheduling Algorithm
• Advanced code motion techniques
DEFINITION
• A list of scheduling algorithm is used to create the
schedule for each basic block.
• The algorithm keeps a list of candidate
instructions,candlnsts,which contains all instructions in the
candidate block.
• It creates the schedule clock by clock.
STRATEGIES:
• Strategies that contains more than one basic block at a time are referred to as global
scheduling.
CONDITIONS:
1. All instructions in the original program are executed in the optimised one.
2. While the optimized program may execute extra instructions speculatively,these
instructions must not have any unwanted side effects.
BASIC BLOCK
• A basic block is constituted by set of instructions in
which the control entre the block through the first
instructions and leaves the block via the last instruction
without any deterrence or jump/branch in between
them.
PRIMITIVE CODE MOTION
Source program :
• Its involved in moving
Operation around by
Way of simple.
If (a ==0) goto L
C ==b
e = d + d
UPWARD CODE MOTION
• It’s move as operation from block SRC up a control flow path to block dsk.
• Such a move does not violate any data deoendences and it makes the path through dst and
src run faster.
• Case 1:
if src does not postdominate dst
In this case there exits a path that passes through dst that does not reach src.
This code motion is illegal unless techoperation moved has no unwanted side effects.
CASE:2 If dst does not dominant src
In this case there exists a path that reach src without first going through dst.
CONSTRAINTS :
1. The operands of the operation must hold the same values as in the original.
2. The result does not overwrite a value that is still needed and,
3. If itself a not subsequently overwritten before reaching src.
DOWNWARD CODE MOTION
• If is moving an operation from block src down a control flow path to block dst.
• CASE 1: src does not dominate dst.
There exists a path to dst that does not passes through src.
• CASE 2: dst does not post dominant src.
There exists a path through src does not pass through dst.
EXAMPLE
• If (x== 0) a=b;
Else a= c;
d=a;
(X==0)
(a==c) (a==b)
(d==a)
UPDATING DATA DEPENDENCE
• Code motions can change data dependence relations between operations.
• Thus the data dependence
Just be updated after each
Code motion.
X=1 X=2
GLOBAL SCHEDULING ALGORITHM
• Region based scheduling
• Two easiest form of code motion
1. Moving Operation up to control equivalent basic blocks.
2. Moving operation Speculatively up one branch to a dominating
predecessor.
ALGORITHM
For (i=0;i<N;i++)
{
S(i);
}
Can be unrolled
For(i=0;i+4<N;i+=4)
{
S(i);
S(i+1);
S(i+2);
S(i+3);
}
Repeat
S;
Until C;
Can be unrolled as
Repeatt
{
S;
If ( C. ) break;
S;
If (C ) break;
S;
}
Until C ;
ADVANCED CODE MOTION TECHNIQUES
• Adding new basic block along the control flow edges originating from blocks with more
than one predecessor.
• The code to be executed in each basic block is scheduling once for all as each block is
visited, because algorithm only move operation up to dominating block.
• Implementing download code motion is harder is an algorithm that visit that topological
order.
Global Code Scheduling Techniques and Algorithms

More Related Content

What's hot

Backtracking & branch and bound
Backtracking & branch and boundBacktracking & branch and bound
Backtracking & branch and boundVipul Chauhan
 
Dijkstra's algorithm presentation
Dijkstra's algorithm presentationDijkstra's algorithm presentation
Dijkstra's algorithm presentationSubid Biswas
 
Symbol table in compiler Design
Symbol table in compiler DesignSymbol table in compiler Design
Symbol table in compiler DesignKuppusamy P
 
Lexical Analysis - Compiler Design
Lexical Analysis - Compiler DesignLexical Analysis - Compiler Design
Lexical Analysis - Compiler DesignAkhil Kaushik
 
Symbol table design (Compiler Construction)
Symbol table design (Compiler Construction)Symbol table design (Compiler Construction)
Symbol table design (Compiler Construction)Tech_MX
 
BackTracking Algorithm: Technique and Examples
BackTracking Algorithm: Technique and ExamplesBackTracking Algorithm: Technique and Examples
BackTracking Algorithm: Technique and ExamplesFahim Ferdous
 
Lecture 14 Heuristic Search-A star algorithm
Lecture 14 Heuristic Search-A star algorithmLecture 14 Heuristic Search-A star algorithm
Lecture 14 Heuristic Search-A star algorithmHema Kashyap
 
Basic Blocks and Flow Graphs
Basic Blocks and Flow GraphsBasic Blocks and Flow Graphs
Basic Blocks and Flow GraphsJenny Galino
 
Algorithms Lecture 7: Graph Algorithms
Algorithms Lecture 7: Graph AlgorithmsAlgorithms Lecture 7: Graph Algorithms
Algorithms Lecture 7: Graph AlgorithmsMohamed Loey
 
Syntax directed translation
Syntax directed translationSyntax directed translation
Syntax directed translationAkshaya Arunan
 
Lexical Analysis
Lexical AnalysisLexical Analysis
Lexical AnalysisMunni28
 
Two phase commit protocol in dbms
Two phase commit protocol in dbmsTwo phase commit protocol in dbms
Two phase commit protocol in dbmsDilouar Hossain
 
Karatsuba algorithm for fast mltiplication
Karatsuba algorithm for fast mltiplicationKaratsuba algorithm for fast mltiplication
Karatsuba algorithm for fast mltiplicationAtul Singh
 
Master method
Master method Master method
Master method Rajendran
 

What's hot (20)

Backtracking & branch and bound
Backtracking & branch and boundBacktracking & branch and bound
Backtracking & branch and bound
 
Dijkstra's algorithm presentation
Dijkstra's algorithm presentationDijkstra's algorithm presentation
Dijkstra's algorithm presentation
 
Symbol table in compiler Design
Symbol table in compiler DesignSymbol table in compiler Design
Symbol table in compiler Design
 
Code generation
Code generationCode generation
Code generation
 
Lexical Analysis - Compiler Design
Lexical Analysis - Compiler DesignLexical Analysis - Compiler Design
Lexical Analysis - Compiler Design
 
Symbol table design (Compiler Construction)
Symbol table design (Compiler Construction)Symbol table design (Compiler Construction)
Symbol table design (Compiler Construction)
 
Compiler Chapter 1
Compiler Chapter 1Compiler Chapter 1
Compiler Chapter 1
 
Minimum spanning tree
Minimum spanning treeMinimum spanning tree
Minimum spanning tree
 
pipelining
pipeliningpipelining
pipelining
 
BackTracking Algorithm: Technique and Examples
BackTracking Algorithm: Technique and ExamplesBackTracking Algorithm: Technique and Examples
BackTracking Algorithm: Technique and Examples
 
Lecture 14 Heuristic Search-A star algorithm
Lecture 14 Heuristic Search-A star algorithmLecture 14 Heuristic Search-A star algorithm
Lecture 14 Heuristic Search-A star algorithm
 
Basic Blocks and Flow Graphs
Basic Blocks and Flow GraphsBasic Blocks and Flow Graphs
Basic Blocks and Flow Graphs
 
Algorithms Lecture 7: Graph Algorithms
Algorithms Lecture 7: Graph AlgorithmsAlgorithms Lecture 7: Graph Algorithms
Algorithms Lecture 7: Graph Algorithms
 
Syntax directed translation
Syntax directed translationSyntax directed translation
Syntax directed translation
 
Loop invariant computation
Loop invariant computationLoop invariant computation
Loop invariant computation
 
Compiler Design
Compiler DesignCompiler Design
Compiler Design
 
Lexical Analysis
Lexical AnalysisLexical Analysis
Lexical Analysis
 
Two phase commit protocol in dbms
Two phase commit protocol in dbmsTwo phase commit protocol in dbms
Two phase commit protocol in dbms
 
Karatsuba algorithm for fast mltiplication
Karatsuba algorithm for fast mltiplicationKaratsuba algorithm for fast mltiplication
Karatsuba algorithm for fast mltiplication
 
Master method
Master method Master method
Master method
 

Similar to Global Code Scheduling Techniques and Algorithms

Cloud computing Module 2 First Part
Cloud computing Module 2 First PartCloud computing Module 2 First Part
Cloud computing Module 2 First PartSoumee Maschatak
 
24-02-18 Rejender pratap.pdf
24-02-18 Rejender pratap.pdf24-02-18 Rejender pratap.pdf
24-02-18 Rejender pratap.pdfFrangoCamila
 
Short.course.introduction.to.vhdl for beginners
Short.course.introduction.to.vhdl for beginners Short.course.introduction.to.vhdl for beginners
Short.course.introduction.to.vhdl for beginners Ravi Sony
 
Slicing of Object-Oriented Programs
Slicing of Object-Oriented ProgramsSlicing of Object-Oriented Programs
Slicing of Object-Oriented ProgramsPraveen Penumathsa
 
Webinar Slides: Tungsten Connector / Proxy – The Secret Sauce Behind Zero-Dow...
Webinar Slides: Tungsten Connector / Proxy – The Secret Sauce Behind Zero-Dow...Webinar Slides: Tungsten Connector / Proxy – The Secret Sauce Behind Zero-Dow...
Webinar Slides: Tungsten Connector / Proxy – The Secret Sauce Behind Zero-Dow...Continuent
 
SDN Architecture & Ecosystem
SDN Architecture & EcosystemSDN Architecture & Ecosystem
SDN Architecture & EcosystemKingston Smiler
 
Software Define Networking (SDN)
Software Define Networking (SDN)Software Define Networking (SDN)
Software Define Networking (SDN)Pradeep Kumar TS
 
Computer Organization : CPU, Memory and I/O organization
Computer Organization : CPU, Memory and I/O organizationComputer Organization : CPU, Memory and I/O organization
Computer Organization : CPU, Memory and I/O organizationAmrutaMehata
 
Tiered Compilation in Hotspot JVM
Tiered Compilation in Hotspot JVMTiered Compilation in Hotspot JVM
Tiered Compilation in Hotspot JVMIgor Veresov
 
FIne Grain Multithreading
FIne Grain MultithreadingFIne Grain Multithreading
FIne Grain MultithreadingDharmesh Tank
 
Principal Sources of Optimization in compiler design
Principal Sources of Optimization in compiler design Principal Sources of Optimization in compiler design
Principal Sources of Optimization in compiler design LogsAk
 
Short.course.introduction.to.vhdl
Short.course.introduction.to.vhdlShort.course.introduction.to.vhdl
Short.course.introduction.to.vhdlRavi Sony
 
Software Define Network
Software Define NetworkSoftware Define Network
Software Define NetworkSubith Babu
 
Sobanski odl summit_2015
Sobanski odl summit_2015Sobanski odl summit_2015
Sobanski odl summit_2015John Sobanski
 
Software Defined Networking - 2
Software Defined Networking - 2Software Defined Networking - 2
Software Defined Networking - 2Pradeep Kumar TS
 

Similar to Global Code Scheduling Techniques and Algorithms (20)

ASIC design verification
ASIC design verificationASIC design verification
ASIC design verification
 
compiler design
compiler designcompiler design
compiler design
 
Cloud computing Module 2 First Part
Cloud computing Module 2 First PartCloud computing Module 2 First Part
Cloud computing Module 2 First Part
 
dspa details
dspa detailsdspa details
dspa details
 
24-02-18 Rejender pratap.pdf
24-02-18 Rejender pratap.pdf24-02-18 Rejender pratap.pdf
24-02-18 Rejender pratap.pdf
 
Short.course.introduction.to.vhdl for beginners
Short.course.introduction.to.vhdl for beginners Short.course.introduction.to.vhdl for beginners
Short.course.introduction.to.vhdl for beginners
 
Slicing of Object-Oriented Programs
Slicing of Object-Oriented ProgramsSlicing of Object-Oriented Programs
Slicing of Object-Oriented Programs
 
Webinar Slides: Tungsten Connector / Proxy – The Secret Sauce Behind Zero-Dow...
Webinar Slides: Tungsten Connector / Proxy – The Secret Sauce Behind Zero-Dow...Webinar Slides: Tungsten Connector / Proxy – The Secret Sauce Behind Zero-Dow...
Webinar Slides: Tungsten Connector / Proxy – The Secret Sauce Behind Zero-Dow...
 
SDN Architecture & Ecosystem
SDN Architecture & EcosystemSDN Architecture & Ecosystem
SDN Architecture & Ecosystem
 
Software Define Networking (SDN)
Software Define Networking (SDN)Software Define Networking (SDN)
Software Define Networking (SDN)
 
Computer Organization : CPU, Memory and I/O organization
Computer Organization : CPU, Memory and I/O organizationComputer Organization : CPU, Memory and I/O organization
Computer Organization : CPU, Memory and I/O organization
 
Onnc intro
Onnc introOnnc intro
Onnc intro
 
Tiered Compilation in Hotspot JVM
Tiered Compilation in Hotspot JVMTiered Compilation in Hotspot JVM
Tiered Compilation in Hotspot JVM
 
FIne Grain Multithreading
FIne Grain MultithreadingFIne Grain Multithreading
FIne Grain Multithreading
 
Principal Sources of Optimization in compiler design
Principal Sources of Optimization in compiler design Principal Sources of Optimization in compiler design
Principal Sources of Optimization in compiler design
 
Short.course.introduction.to.vhdl
Short.course.introduction.to.vhdlShort.course.introduction.to.vhdl
Short.course.introduction.to.vhdl
 
Software Define Network
Software Define NetworkSoftware Define Network
Software Define Network
 
Sobanski odl summit_2015
Sobanski odl summit_2015Sobanski odl summit_2015
Sobanski odl summit_2015
 
Software Defined Networking - 2
Software Defined Networking - 2Software Defined Networking - 2
Software Defined Networking - 2
 
Rseminarp
RseminarpRseminarp
Rseminarp
 

More from sowfi

Lavanya m.sc
Lavanya m.scLavanya m.sc
Lavanya m.scsowfi
 
Lavanya m.sc
Lavanya m.scLavanya m.sc
Lavanya m.scsowfi
 
Soundarya m.sc
Soundarya m.scSoundarya m.sc
Soundarya m.scsowfi
 
Software engineering 2
Software engineering 2Software engineering 2
Software engineering 2sowfi
 
Big data analytics
Big data analyticsBig data analytics
Big data analyticssowfi
 
Web programming
Web programmingWeb programming
Web programmingsowfi
 
RDBMS
RDBMSRDBMS
RDBMSsowfi
 
RDBMS
RDBMSRDBMS
RDBMSsowfi
 
connected compounds
connected compoundsconnected compounds
connected compoundssowfi
 
GENETIC ALGORITHM
GENETIC ALGORITHMGENETIC ALGORITHM
GENETIC ALGORITHMsowfi
 
JDBE
JDBEJDBE
JDBEsowfi
 
AUTO & HETRO CORRELATOR
AUTO & HETRO CORRELATORAUTO & HETRO CORRELATOR
AUTO & HETRO CORRELATORsowfi
 
single source shorest path
single source shorest pathsingle source shorest path
single source shorest pathsowfi
 
servlet in java
servlet in javaservlet in java
servlet in javasowfi
 

More from sowfi (20)

Lavanya m.sc
Lavanya m.scLavanya m.sc
Lavanya m.sc
 
Lavanya m.sc
Lavanya m.scLavanya m.sc
Lavanya m.sc
 
Soundarya m.sc
Soundarya m.scSoundarya m.sc
Soundarya m.sc
 
Software engineering 2
Software engineering 2Software engineering 2
Software engineering 2
 
Big data analytics
Big data analyticsBig data analytics
Big data analytics
 
Web programming
Web programmingWeb programming
Web programming
 
OS
OSOS
OS
 
OS
OSOS
OS
 
RDBMS
RDBMSRDBMS
RDBMS
 
DM
DMDM
DM
 
CN
CNCN
CN
 
CN
CNCN
CN
 
Dm
DmDm
Dm
 
RDBMS
RDBMSRDBMS
RDBMS
 
connected compounds
connected compoundsconnected compounds
connected compounds
 
GENETIC ALGORITHM
GENETIC ALGORITHMGENETIC ALGORITHM
GENETIC ALGORITHM
 
JDBE
JDBEJDBE
JDBE
 
AUTO & HETRO CORRELATOR
AUTO & HETRO CORRELATORAUTO & HETRO CORRELATOR
AUTO & HETRO CORRELATOR
 
single source shorest path
single source shorest pathsingle source shorest path
single source shorest path
 
servlet in java
servlet in javaservlet in java
servlet in java
 

Recently uploaded

ECONOMIC CONTEXT - LONG FORM TV DRAMA - PPT
ECONOMIC CONTEXT - LONG FORM TV DRAMA - PPTECONOMIC CONTEXT - LONG FORM TV DRAMA - PPT
ECONOMIC CONTEXT - LONG FORM TV DRAMA - PPTiammrhaywood
 
Meghan Sutherland In Media Res Media Component
Meghan Sutherland In Media Res Media ComponentMeghan Sutherland In Media Res Media Component
Meghan Sutherland In Media Res Media ComponentInMediaRes1
 
Crayon Activity Handout For the Crayon A
Crayon Activity Handout For the Crayon ACrayon Activity Handout For the Crayon A
Crayon Activity Handout For the Crayon AUnboundStockton
 
“Oh GOSH! Reflecting on Hackteria's Collaborative Practices in a Global Do-It...
“Oh GOSH! Reflecting on Hackteria's Collaborative Practices in a Global Do-It...“Oh GOSH! Reflecting on Hackteria's Collaborative Practices in a Global Do-It...
“Oh GOSH! Reflecting on Hackteria's Collaborative Practices in a Global Do-It...Marc Dusseiller Dusjagr
 
Roles & Responsibilities in Pharmacovigilance
Roles & Responsibilities in PharmacovigilanceRoles & Responsibilities in Pharmacovigilance
Roles & Responsibilities in PharmacovigilanceSamikshaHamane
 
ECONOMIC CONTEXT - PAPER 1 Q3: NEWSPAPERS.pptx
ECONOMIC CONTEXT - PAPER 1 Q3: NEWSPAPERS.pptxECONOMIC CONTEXT - PAPER 1 Q3: NEWSPAPERS.pptx
ECONOMIC CONTEXT - PAPER 1 Q3: NEWSPAPERS.pptxiammrhaywood
 
Difference Between Search & Browse Methods in Odoo 17
Difference Between Search & Browse Methods in Odoo 17Difference Between Search & Browse Methods in Odoo 17
Difference Between Search & Browse Methods in Odoo 17Celine George
 
Employee wellbeing at the workplace.pptx
Employee wellbeing at the workplace.pptxEmployee wellbeing at the workplace.pptx
Employee wellbeing at the workplace.pptxNirmalaLoungPoorunde1
 
Like-prefer-love -hate+verb+ing & silent letters & citizenship text.pdf
Like-prefer-love -hate+verb+ing & silent letters & citizenship text.pdfLike-prefer-love -hate+verb+ing & silent letters & citizenship text.pdf
Like-prefer-love -hate+verb+ing & silent letters & citizenship text.pdfMr Bounab Samir
 
MARGINALIZATION (Different learners in Marginalized Group
MARGINALIZATION (Different learners in Marginalized GroupMARGINALIZATION (Different learners in Marginalized Group
MARGINALIZATION (Different learners in Marginalized GroupJonathanParaisoCruz
 
Computed Fields and api Depends in the Odoo 17
Computed Fields and api Depends in the Odoo 17Computed Fields and api Depends in the Odoo 17
Computed Fields and api Depends in the Odoo 17Celine George
 
18-04-UA_REPORT_MEDIALITERAСY_INDEX-DM_23-1-final-eng.pdf
18-04-UA_REPORT_MEDIALITERAСY_INDEX-DM_23-1-final-eng.pdf18-04-UA_REPORT_MEDIALITERAСY_INDEX-DM_23-1-final-eng.pdf
18-04-UA_REPORT_MEDIALITERAСY_INDEX-DM_23-1-final-eng.pdfssuser54595a
 
Presiding Officer Training module 2024 lok sabha elections
Presiding Officer Training module 2024 lok sabha electionsPresiding Officer Training module 2024 lok sabha elections
Presiding Officer Training module 2024 lok sabha electionsanshu789521
 
Capitol Tech U Doctoral Presentation - April 2024.pptx
Capitol Tech U Doctoral Presentation - April 2024.pptxCapitol Tech U Doctoral Presentation - April 2024.pptx
Capitol Tech U Doctoral Presentation - April 2024.pptxCapitolTechU
 
Alper Gobel In Media Res Media Component
Alper Gobel In Media Res Media ComponentAlper Gobel In Media Res Media Component
Alper Gobel In Media Res Media ComponentInMediaRes1
 
Types of Journalistic Writing Grade 8.pptx
Types of Journalistic Writing Grade 8.pptxTypes of Journalistic Writing Grade 8.pptx
Types of Journalistic Writing Grade 8.pptxEyham Joco
 
Introduction to AI in Higher Education_draft.pptx
Introduction to AI in Higher Education_draft.pptxIntroduction to AI in Higher Education_draft.pptx
Introduction to AI in Higher Education_draft.pptxpboyjonauth
 

Recently uploaded (20)

ECONOMIC CONTEXT - LONG FORM TV DRAMA - PPT
ECONOMIC CONTEXT - LONG FORM TV DRAMA - PPTECONOMIC CONTEXT - LONG FORM TV DRAMA - PPT
ECONOMIC CONTEXT - LONG FORM TV DRAMA - PPT
 
Meghan Sutherland In Media Res Media Component
Meghan Sutherland In Media Res Media ComponentMeghan Sutherland In Media Res Media Component
Meghan Sutherland In Media Res Media Component
 
Crayon Activity Handout For the Crayon A
Crayon Activity Handout For the Crayon ACrayon Activity Handout For the Crayon A
Crayon Activity Handout For the Crayon A
 
“Oh GOSH! Reflecting on Hackteria's Collaborative Practices in a Global Do-It...
“Oh GOSH! Reflecting on Hackteria's Collaborative Practices in a Global Do-It...“Oh GOSH! Reflecting on Hackteria's Collaborative Practices in a Global Do-It...
“Oh GOSH! Reflecting on Hackteria's Collaborative Practices in a Global Do-It...
 
Roles & Responsibilities in Pharmacovigilance
Roles & Responsibilities in PharmacovigilanceRoles & Responsibilities in Pharmacovigilance
Roles & Responsibilities in Pharmacovigilance
 
ECONOMIC CONTEXT - PAPER 1 Q3: NEWSPAPERS.pptx
ECONOMIC CONTEXT - PAPER 1 Q3: NEWSPAPERS.pptxECONOMIC CONTEXT - PAPER 1 Q3: NEWSPAPERS.pptx
ECONOMIC CONTEXT - PAPER 1 Q3: NEWSPAPERS.pptx
 
Difference Between Search & Browse Methods in Odoo 17
Difference Between Search & Browse Methods in Odoo 17Difference Between Search & Browse Methods in Odoo 17
Difference Between Search & Browse Methods in Odoo 17
 
ESSENTIAL of (CS/IT/IS) class 06 (database)
ESSENTIAL of (CS/IT/IS) class 06 (database)ESSENTIAL of (CS/IT/IS) class 06 (database)
ESSENTIAL of (CS/IT/IS) class 06 (database)
 
Employee wellbeing at the workplace.pptx
Employee wellbeing at the workplace.pptxEmployee wellbeing at the workplace.pptx
Employee wellbeing at the workplace.pptx
 
Like-prefer-love -hate+verb+ing & silent letters & citizenship text.pdf
Like-prefer-love -hate+verb+ing & silent letters & citizenship text.pdfLike-prefer-love -hate+verb+ing & silent letters & citizenship text.pdf
Like-prefer-love -hate+verb+ing & silent letters & citizenship text.pdf
 
MARGINALIZATION (Different learners in Marginalized Group
MARGINALIZATION (Different learners in Marginalized GroupMARGINALIZATION (Different learners in Marginalized Group
MARGINALIZATION (Different learners in Marginalized Group
 
Computed Fields and api Depends in the Odoo 17
Computed Fields and api Depends in the Odoo 17Computed Fields and api Depends in the Odoo 17
Computed Fields and api Depends in the Odoo 17
 
18-04-UA_REPORT_MEDIALITERAСY_INDEX-DM_23-1-final-eng.pdf
18-04-UA_REPORT_MEDIALITERAСY_INDEX-DM_23-1-final-eng.pdf18-04-UA_REPORT_MEDIALITERAСY_INDEX-DM_23-1-final-eng.pdf
18-04-UA_REPORT_MEDIALITERAСY_INDEX-DM_23-1-final-eng.pdf
 
Presiding Officer Training module 2024 lok sabha elections
Presiding Officer Training module 2024 lok sabha electionsPresiding Officer Training module 2024 lok sabha elections
Presiding Officer Training module 2024 lok sabha elections
 
Capitol Tech U Doctoral Presentation - April 2024.pptx
Capitol Tech U Doctoral Presentation - April 2024.pptxCapitol Tech U Doctoral Presentation - April 2024.pptx
Capitol Tech U Doctoral Presentation - April 2024.pptx
 
Model Call Girl in Tilak Nagar Delhi reach out to us at 🔝9953056974🔝
Model Call Girl in Tilak Nagar Delhi reach out to us at 🔝9953056974🔝Model Call Girl in Tilak Nagar Delhi reach out to us at 🔝9953056974🔝
Model Call Girl in Tilak Nagar Delhi reach out to us at 🔝9953056974🔝
 
Alper Gobel In Media Res Media Component
Alper Gobel In Media Res Media ComponentAlper Gobel In Media Res Media Component
Alper Gobel In Media Res Media Component
 
9953330565 Low Rate Call Girls In Rohini Delhi NCR
9953330565 Low Rate Call Girls In Rohini  Delhi NCR9953330565 Low Rate Call Girls In Rohini  Delhi NCR
9953330565 Low Rate Call Girls In Rohini Delhi NCR
 
Types of Journalistic Writing Grade 8.pptx
Types of Journalistic Writing Grade 8.pptxTypes of Journalistic Writing Grade 8.pptx
Types of Journalistic Writing Grade 8.pptx
 
Introduction to AI in Higher Education_draft.pptx
Introduction to AI in Higher Education_draft.pptxIntroduction to AI in Higher Education_draft.pptx
Introduction to AI in Higher Education_draft.pptx
 

Global Code Scheduling Techniques and Algorithms

  • 1. GLOBAL CODE SCHEDULING B.SOUNDARYA , II M.SC(COMPUTER SCIENCE) DEPARTMENT OF CS & IT COMPILER DESIGN NADAR SARASWATHI COLLEGE OF ART’S &SCIENCE
  • 2. INTRODUCTION • Definition • Strategies • Basic block • Primitive code motion • Upward code motion • Downward code motion • Global scheduling Algorithm • Advanced code motion techniques
  • 3. DEFINITION • A list of scheduling algorithm is used to create the schedule for each basic block. • The algorithm keeps a list of candidate instructions,candlnsts,which contains all instructions in the candidate block. • It creates the schedule clock by clock.
  • 4. STRATEGIES: • Strategies that contains more than one basic block at a time are referred to as global scheduling. CONDITIONS: 1. All instructions in the original program are executed in the optimised one. 2. While the optimized program may execute extra instructions speculatively,these instructions must not have any unwanted side effects.
  • 5. BASIC BLOCK • A basic block is constituted by set of instructions in which the control entre the block through the first instructions and leaves the block via the last instruction without any deterrence or jump/branch in between them.
  • 6. PRIMITIVE CODE MOTION Source program : • Its involved in moving Operation around by Way of simple. If (a ==0) goto L C ==b e = d + d
  • 7. UPWARD CODE MOTION • It’s move as operation from block SRC up a control flow path to block dsk. • Such a move does not violate any data deoendences and it makes the path through dst and src run faster. • Case 1: if src does not postdominate dst In this case there exits a path that passes through dst that does not reach src. This code motion is illegal unless techoperation moved has no unwanted side effects.
  • 8. CASE:2 If dst does not dominant src In this case there exists a path that reach src without first going through dst. CONSTRAINTS : 1. The operands of the operation must hold the same values as in the original. 2. The result does not overwrite a value that is still needed and, 3. If itself a not subsequently overwritten before reaching src.
  • 9. DOWNWARD CODE MOTION • If is moving an operation from block src down a control flow path to block dst. • CASE 1: src does not dominate dst. There exists a path to dst that does not passes through src. • CASE 2: dst does not post dominant src. There exists a path through src does not pass through dst.
  • 10. EXAMPLE • If (x== 0) a=b; Else a= c; d=a; (X==0) (a==c) (a==b) (d==a)
  • 11. UPDATING DATA DEPENDENCE • Code motions can change data dependence relations between operations. • Thus the data dependence Just be updated after each Code motion. X=1 X=2
  • 12. GLOBAL SCHEDULING ALGORITHM • Region based scheduling • Two easiest form of code motion 1. Moving Operation up to control equivalent basic blocks. 2. Moving operation Speculatively up one branch to a dominating predecessor.
  • 13. ALGORITHM For (i=0;i<N;i++) { S(i); } Can be unrolled For(i=0;i+4<N;i+=4) { S(i); S(i+1); S(i+2); S(i+3); } Repeat S; Until C; Can be unrolled as Repeatt { S; If ( C. ) break; S; If (C ) break; S; } Until C ;
  • 14. ADVANCED CODE MOTION TECHNIQUES • Adding new basic block along the control flow edges originating from blocks with more than one predecessor. • The code to be executed in each basic block is scheduling once for all as each block is visited, because algorithm only move operation up to dominating block. • Implementing download code motion is harder is an algorithm that visit that topological order.