SlideShare a Scribd company logo
1 of 21
B.Sakthibala,
II-M.Sc (CS)
Department of CS&IT
Nadar Saraswathi college of arts
&science.
BASIC BLOCK SCHEDULING
 Scheduling operations in a basic block consisting of
machine instructions.
 Solving this problem optimally is NP-complete. But in
practice, a typical basic block has only a small number
of highly constrained operations, so simple scheduling
techniques suffice.
 A simple but highly effective algorithm, called list
scheduling, for this problem
Data dependence graph
 Each basic block of machine instructions by a data-
dependence graph, G = (N,E), having a set of nodes N
representing the operations in the machine instructions in
the block and a set of directed edges E representing the
data-dependence constraints among the operations.
 The nodes and edges of G are constructed as follows:
 1. Each operation n in N has a resource-reservation table
RTn, whose value is simply the resource-reservation
table associated with the operation type of n.
 That is, the last instruction may be storing into the same
address that the third instruction loads from. The
machine model we are using allows us to store into a
location one clock after we load from that location, even
though the value to be loaded will not appear in a
register until one clock later.
 This observation explains the label 1 on the edge from
the third instruction to the last. The same reasoning
explains the edge and label from the first instruction to
the last. The other edges with label 1 are explained by a
dependence or possible dependence conditioned on the
value of R7.
List scheduling of basic blocks
 The simplest approach to scheduling basic blocks
involves visiting each node of the data-dependence graph
in “prioritized topological order." Since there can be no
cycles in a data-dependence graph, there is always at
least one topological order for the nodes. However,
among the possible topological orders, some may be
preferable to others.
Prioritized topological order
 List scheduling does not backtrack; it schedules each
node once and only once. It uses a heuristic priority
function to choose among the nodes that are ready to be
scheduled next.
 Without resource constraints, the shortest schedule is
given by the critical path, the longest path through the
data-dependence graph. A metric useful as a priority
function is the height of the node, which is the length of a
longest path in the graph originating from the node.
 On the other hand, if all operations are independent, then
the length of the schedule is constrained by the resources
available. The critical resource is the one with the largest
ratio of uses to the number of units of that resource
available. Operations using more critical resources may
be given higher priority.
 Finally, the source ordering to break ties between
operations; the operation that shows up earlier in the
source program should be scheduled first.
GLOBAL CODE SCHEDULING
Global code scheduling
 For a machine with a moderate amount of instruction-
level parallelism, schedules created by compacting
individual basic blocks tend to leave many resources idle.
 In order to make better use of machine resources, it is
necessary to consider code-generation strategies that
move instructions from one basic block to another.
 Strategies that consider more than one basic block at a
time are referred to as global scheduling algorithms. To do
global scheduling correctly, we must consider not only
data dependences but also control dependences.
Upward code motion
 Suppose we wish to move an operation from block src up
a control- flow path to block dst. We assume that such a
move does not violate any data dependences and that it
makes paths through dst and src run faster.
 If dst dominates src, and src postdominates dst, then the
operation moved is executed once and only once, when it
should.
If src does not post-dominate dst
 Then there exists a path that passes through dst that
does not reach src. An extra operation would have
been executed in this case.
 If the moved operation executes “for free" i.e., it uses
only resources that otherwise would be idle, then this
move has no cost. It is beneficial only if the control
flow reaches src.
If dst does not dominate src
 Then there exists a path that reaches src without first
going through dst.
 We need to insert copies of the moved operation along
such paths.
 We place copies of the operation along basic blocks that
form a cut set separating the entry block from src
Downward code motion
 Suppose we are interested in moving an operation from
block src down a control flow path to block dst. We
can reason about such code motion in the same way as
above.
 If src does not dominate dst
 If dst does not post-dominate src
Updating Data Dependences
 code motion can change the data dependence relations
between operations. Thus data dependences must be
updated after each code movement.
Global scheduling Algorithm
 we should aim to make the frequently executed paths run
faster while possibly making the less frequent paths run
slower.
 There are a number of techniques a compiler can use to
estimate execution frequencies.
 It is reasonable to assume that instructions in the innermost
loops are executed more often than code in outer loops, and
that branches that go backward are more likely to be taken
than not taken.
Region-Based Scheduling
 We now describe a straightforward global
scheduler that supports the two easiest forms of
code motion:
1. Moving operations up to control-equivalent basic
blocks, and
2. Moving operations speculatively up one branch to
a dominating predecessor.
Advanced code motion Techniques
 If our target machine is statically scheduled and has
plenty of instruction-level parallelism, we may need a
more aggressive algorithm.
 To facilitate the extensions below, we can add new basic
blocks along control- flow edges originating from blocks
with more than one predecessor. These basic blocks will
be eliminated at the end of code scheduling if they are
empty.
Interaction with dynamic schedulers
 A dynamic scheduler has the advantage that it can
create new schedules according to the run-time
conditions, without having to encode all these possible
schedules ahead of time.
 If a target machine has a dynamic scheduler, the static
scheduler's primary function is to ensure that
instructions with high latency are fetched early so that
the dynamic scheduler can issue them as early as
possible.
 If dynamic scheduling is not available on the target
machine, the static scheduler must be conservative
and separate every data-dependent pair of operations
by the minimum delay.
 If dynamic scheduling is available, however, the
compiler only needs to place the data-dependent
operations in the correct order to ensure program
correctness.
BSakthibala Global and Basic Block Code Scheduling Techniques

More Related Content

What's hot

management of distributed transactions
management of distributed transactionsmanagement of distributed transactions
management of distributed transactionsNilu Desai
 
3 Tier Architecture
3 Tier Architecture3 Tier Architecture
3 Tier Architectureguestd0cc01
 
Routing in Mobile Ad hoc Networks
Routing in Mobile Ad hoc NetworksRouting in Mobile Ad hoc Networks
Routing in Mobile Ad hoc NetworksSayed Chhattan Shah
 
Data-Centric Routing Protocols in Wireless Sensor Network: A survey
Data-Centric Routing Protocols in Wireless Sensor Network: A surveyData-Centric Routing Protocols in Wireless Sensor Network: A survey
Data-Centric Routing Protocols in Wireless Sensor Network: A surveyAli Habeeb
 
EX-6-Implement Matrix Multiplication with Hadoop Map Reduce.pptx
EX-6-Implement Matrix Multiplication with Hadoop Map Reduce.pptxEX-6-Implement Matrix Multiplication with Hadoop Map Reduce.pptx
EX-6-Implement Matrix Multiplication with Hadoop Map Reduce.pptxvishal choudhary
 
Distributed DBMS - Unit 8 - Distributed Transaction Management & Concurrency ...
Distributed DBMS - Unit 8 - Distributed Transaction Management & Concurrency ...Distributed DBMS - Unit 8 - Distributed Transaction Management & Concurrency ...
Distributed DBMS - Unit 8 - Distributed Transaction Management & Concurrency ...Gyanmanjari Institute Of Technology
 
Query processing and optimization (updated)
Query processing and optimization (updated)Query processing and optimization (updated)
Query processing and optimization (updated)Ravinder Kamboj
 
Complete dbms notes
Complete dbms notesComplete dbms notes
Complete dbms notesTanya Makkar
 
3 Tier Architecture
3  Tier Architecture3  Tier Architecture
3 Tier ArchitectureWebx
 
Levels of Virtualization.docx
Levels of Virtualization.docxLevels of Virtualization.docx
Levels of Virtualization.docxkumari36
 
Address calculation-sort
Address calculation-sortAddress calculation-sort
Address calculation-sortVasim Pathan
 
Join ordering in fragment queries
Join ordering in fragment queriesJoin ordering in fragment queries
Join ordering in fragment queriesIfzalhussainkhan
 
Mobile Network Layer
Mobile Network LayerMobile Network Layer
Mobile Network LayerRahul Hada
 

What's hot (20)

management of distributed transactions
management of distributed transactionsmanagement of distributed transactions
management of distributed transactions
 
3. cs8451 daa anna univ question bank unit 3
3. cs8451 daa anna univ question bank unit 33. cs8451 daa anna univ question bank unit 3
3. cs8451 daa anna univ question bank unit 3
 
Map Reduce
Map ReduceMap Reduce
Map Reduce
 
Distributed deadlock
Distributed deadlockDistributed deadlock
Distributed deadlock
 
3 Tier Architecture
3 Tier Architecture3 Tier Architecture
3 Tier Architecture
 
Routing in Mobile Ad hoc Networks
Routing in Mobile Ad hoc NetworksRouting in Mobile Ad hoc Networks
Routing in Mobile Ad hoc Networks
 
Data-Centric Routing Protocols in Wireless Sensor Network: A survey
Data-Centric Routing Protocols in Wireless Sensor Network: A surveyData-Centric Routing Protocols in Wireless Sensor Network: A survey
Data-Centric Routing Protocols in Wireless Sensor Network: A survey
 
EX-6-Implement Matrix Multiplication with Hadoop Map Reduce.pptx
EX-6-Implement Matrix Multiplication with Hadoop Map Reduce.pptxEX-6-Implement Matrix Multiplication with Hadoop Map Reduce.pptx
EX-6-Implement Matrix Multiplication with Hadoop Map Reduce.pptx
 
Distributed DBMS - Unit 5 - Semantic Data Control
Distributed DBMS - Unit 5 - Semantic Data ControlDistributed DBMS - Unit 5 - Semantic Data Control
Distributed DBMS - Unit 5 - Semantic Data Control
 
Distributed DBMS - Unit 8 - Distributed Transaction Management & Concurrency ...
Distributed DBMS - Unit 8 - Distributed Transaction Management & Concurrency ...Distributed DBMS - Unit 8 - Distributed Transaction Management & Concurrency ...
Distributed DBMS - Unit 8 - Distributed Transaction Management & Concurrency ...
 
Query processing and optimization (updated)
Query processing and optimization (updated)Query processing and optimization (updated)
Query processing and optimization (updated)
 
Complete dbms notes
Complete dbms notesComplete dbms notes
Complete dbms notes
 
3 Tier Architecture
3  Tier Architecture3  Tier Architecture
3 Tier Architecture
 
Levels of Virtualization.docx
Levels of Virtualization.docxLevels of Virtualization.docx
Levels of Virtualization.docx
 
Address calculation-sort
Address calculation-sortAddress calculation-sort
Address calculation-sort
 
Join ordering in fragment queries
Join ordering in fragment queriesJoin ordering in fragment queries
Join ordering in fragment queries
 
Load balancing
Load balancingLoad balancing
Load balancing
 
Query processing
Query processingQuery processing
Query processing
 
Unit 4
Unit 4Unit 4
Unit 4
 
Mobile Network Layer
Mobile Network LayerMobile Network Layer
Mobile Network Layer
 

Similar to BSakthibala Global and Basic Block Code Scheduling Techniques

ORCHESTRATING BULK DATA TRANSFERS ACROSS GEO-DISTRIBUTED DATACENTERS
ORCHESTRATING BULK DATA TRANSFERS ACROSS GEO-DISTRIBUTED DATACENTERSORCHESTRATING BULK DATA TRANSFERS ACROSS GEO-DISTRIBUTED DATACENTERS
ORCHESTRATING BULK DATA TRANSFERS ACROSS GEO-DISTRIBUTED DATACENTERSNexgen Technology
 
Orchestrating bulk data transfers across
Orchestrating bulk data transfers acrossOrchestrating bulk data transfers across
Orchestrating bulk data transfers acrossnexgentech15
 
Orchestrating Bulk Data Transfers across Geo-Distributed Datacenters
 Orchestrating Bulk Data Transfers across Geo-Distributed Datacenters Orchestrating Bulk Data Transfers across Geo-Distributed Datacenters
Orchestrating Bulk Data Transfers across Geo-Distributed Datacentersnexgentechnology
 
Load balancing in Distributed Systems
Load balancing in Distributed SystemsLoad balancing in Distributed Systems
Load balancing in Distributed SystemsRicha Singh
 
You are to simulate a dispatcher using a priority queue system.New.pdf
You are to simulate a dispatcher using a priority queue system.New.pdfYou are to simulate a dispatcher using a priority queue system.New.pdf
You are to simulate a dispatcher using a priority queue system.New.pdfgardenvarelianand
 
A survey of various scheduling algorithm in cloud computing environment
A survey of various scheduling algorithm in cloud computing environmentA survey of various scheduling algorithm in cloud computing environment
A survey of various scheduling algorithm in cloud computing environmenteSAT Journals
 
A survey of various scheduling algorithm in cloud computing environment
A survey of various scheduling algorithm in cloud computing environmentA survey of various scheduling algorithm in cloud computing environment
A survey of various scheduling algorithm in cloud computing environmenteSAT Publishing House
 
Nearest Adjacent Node Discovery Scheme for Routing Protocol in Wireless Senso...
Nearest Adjacent Node Discovery Scheme for Routing Protocol in Wireless Senso...Nearest Adjacent Node Discovery Scheme for Routing Protocol in Wireless Senso...
Nearest Adjacent Node Discovery Scheme for Routing Protocol in Wireless Senso...IOSR Journals
 
The Concept of Load Balancing Server in Secured and Intelligent Network
The Concept of Load Balancing Server in Secured and Intelligent NetworkThe Concept of Load Balancing Server in Secured and Intelligent Network
The Concept of Load Balancing Server in Secured and Intelligent NetworkIJAEMSJORNAL
 
Iaetsd improved load balancing model based on
Iaetsd improved load balancing model based onIaetsd improved load balancing model based on
Iaetsd improved load balancing model based onIaetsd Iaetsd
 
Hybrid Scheduling Algorithm for Efficient Load Balancing In Cloud Computing
Hybrid Scheduling Algorithm for Efficient Load Balancing In Cloud ComputingHybrid Scheduling Algorithm for Efficient Load Balancing In Cloud Computing
Hybrid Scheduling Algorithm for Efficient Load Balancing In Cloud ComputingEswar Publications
 
40414094210-phpapp01 (1).pdf
40414094210-phpapp01 (1).pdf40414094210-phpapp01 (1).pdf
40414094210-phpapp01 (1).pdfRebaMaheen
 
Load Balancing In Distributed Computing
Load Balancing In Distributed ComputingLoad Balancing In Distributed Computing
Load Balancing In Distributed ComputingRicha Singh
 
Distributed System Management
Distributed System ManagementDistributed System Management
Distributed System ManagementIbrahim Amer
 

Similar to BSakthibala Global and Basic Block Code Scheduling Techniques (20)

Compiler Design
Compiler DesignCompiler Design
Compiler Design
 
Resource management
Resource managementResource management
Resource management
 
ORCHESTRATING BULK DATA TRANSFERS ACROSS GEO-DISTRIBUTED DATACENTERS
ORCHESTRATING BULK DATA TRANSFERS ACROSS GEO-DISTRIBUTED DATACENTERSORCHESTRATING BULK DATA TRANSFERS ACROSS GEO-DISTRIBUTED DATACENTERS
ORCHESTRATING BULK DATA TRANSFERS ACROSS GEO-DISTRIBUTED DATACENTERS
 
Orchestrating bulk data transfers across
Orchestrating bulk data transfers acrossOrchestrating bulk data transfers across
Orchestrating bulk data transfers across
 
Orchestrating Bulk Data Transfers across Geo-Distributed Datacenters
 Orchestrating Bulk Data Transfers across Geo-Distributed Datacenters Orchestrating Bulk Data Transfers across Geo-Distributed Datacenters
Orchestrating Bulk Data Transfers across Geo-Distributed Datacenters
 
Load balancing in Distributed Systems
Load balancing in Distributed SystemsLoad balancing in Distributed Systems
Load balancing in Distributed Systems
 
You are to simulate a dispatcher using a priority queue system.New.pdf
You are to simulate a dispatcher using a priority queue system.New.pdfYou are to simulate a dispatcher using a priority queue system.New.pdf
You are to simulate a dispatcher using a priority queue system.New.pdf
 
A survey of various scheduling algorithm in cloud computing environment
A survey of various scheduling algorithm in cloud computing environmentA survey of various scheduling algorithm in cloud computing environment
A survey of various scheduling algorithm in cloud computing environment
 
A survey of various scheduling algorithm in cloud computing environment
A survey of various scheduling algorithm in cloud computing environmentA survey of various scheduling algorithm in cloud computing environment
A survey of various scheduling algorithm in cloud computing environment
 
Computer architecture
Computer architectureComputer architecture
Computer architecture
 
Oversimplified CA
Oversimplified CAOversimplified CA
Oversimplified CA
 
Nearest Adjacent Node Discovery Scheme for Routing Protocol in Wireless Senso...
Nearest Adjacent Node Discovery Scheme for Routing Protocol in Wireless Senso...Nearest Adjacent Node Discovery Scheme for Routing Protocol in Wireless Senso...
Nearest Adjacent Node Discovery Scheme for Routing Protocol in Wireless Senso...
 
The Concept of Load Balancing Server in Secured and Intelligent Network
The Concept of Load Balancing Server in Secured and Intelligent NetworkThe Concept of Load Balancing Server in Secured and Intelligent Network
The Concept of Load Balancing Server in Secured and Intelligent Network
 
1844 1849
1844 18491844 1849
1844 1849
 
1844 1849
1844 18491844 1849
1844 1849
 
Iaetsd improved load balancing model based on
Iaetsd improved load balancing model based onIaetsd improved load balancing model based on
Iaetsd improved load balancing model based on
 
Hybrid Scheduling Algorithm for Efficient Load Balancing In Cloud Computing
Hybrid Scheduling Algorithm for Efficient Load Balancing In Cloud ComputingHybrid Scheduling Algorithm for Efficient Load Balancing In Cloud Computing
Hybrid Scheduling Algorithm for Efficient Load Balancing In Cloud Computing
 
40414094210-phpapp01 (1).pdf
40414094210-phpapp01 (1).pdf40414094210-phpapp01 (1).pdf
40414094210-phpapp01 (1).pdf
 
Load Balancing In Distributed Computing
Load Balancing In Distributed ComputingLoad Balancing In Distributed Computing
Load Balancing In Distributed Computing
 
Distributed System Management
Distributed System ManagementDistributed System Management
Distributed System Management
 

More from sakthibalabalamuruga (14)

Software engineering
Software engineeringSoftware engineering
Software engineering
 
Software engineering
Software  engineeringSoftware  engineering
Software engineering
 
web programming
web programmingweb programming
web programming
 
Bigdata
BigdataBigdata
Bigdata
 
Os
OsOs
Os
 
Apache mahout and R-mining complex dataobject
Apache mahout and R-mining complex dataobjectApache mahout and R-mining complex dataobject
Apache mahout and R-mining complex dataobject
 
Computer network
Computer networkComputer network
Computer network
 
Operating system
Operating systemOperating system
Operating system
 
Rdbms
RdbmsRdbms
Rdbms
 
Rdbms
RdbmsRdbms
Rdbms
 
Rdbms
RdbmsRdbms
Rdbms
 
Encoding
EncodingEncoding
Encoding
 
Data structure and algorithm
Data structure and algorithmData structure and algorithm
Data structure and algorithm
 
Remote method invocatiom
Remote method invocatiomRemote method invocatiom
Remote method invocatiom
 

Recently uploaded

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
 
Final demo Grade 9 for demo Plan dessert.pptx
Final demo Grade 9 for demo Plan dessert.pptxFinal demo Grade 9 for demo Plan dessert.pptx
Final demo Grade 9 for demo Plan dessert.pptxAvyJaneVismanos
 
Employee wellbeing at the workplace.pptx
Employee wellbeing at the workplace.pptxEmployee wellbeing at the workplace.pptx
Employee wellbeing at the workplace.pptxNirmalaLoungPoorunde1
 
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
 
call girls in Kamla Market (DELHI) 🔝 >༒9953330565🔝 genuine Escort Service 🔝✔️✔️
call girls in Kamla Market (DELHI) 🔝 >༒9953330565🔝 genuine Escort Service 🔝✔️✔️call girls in Kamla Market (DELHI) 🔝 >༒9953330565🔝 genuine Escort Service 🔝✔️✔️
call girls in Kamla Market (DELHI) 🔝 >༒9953330565🔝 genuine Escort Service 🔝✔️✔️9953056974 Low Rate Call Girls In Saket, Delhi NCR
 
MICROBIOLOGY biochemical test detailed.pptx
MICROBIOLOGY biochemical test detailed.pptxMICROBIOLOGY biochemical test detailed.pptx
MICROBIOLOGY biochemical test detailed.pptxabhijeetpadhi001
 
MARGINALIZATION (Different learners in Marginalized Group
MARGINALIZATION (Different learners in Marginalized GroupMARGINALIZATION (Different learners in Marginalized Group
MARGINALIZATION (Different learners in Marginalized GroupJonathanParaisoCruz
 
How to Configure Email Server in Odoo 17
How to Configure Email Server in Odoo 17How to Configure Email Server in Odoo 17
How to Configure Email Server in Odoo 17Celine George
 
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
 
Gas measurement O2,Co2,& ph) 04/2024.pptx
Gas measurement O2,Co2,& ph) 04/2024.pptxGas measurement O2,Co2,& ph) 04/2024.pptx
Gas measurement O2,Co2,& ph) 04/2024.pptxDr.Ibrahim Hassaan
 
Organic Name Reactions for the students and aspirants of Chemistry12th.pptx
Organic Name Reactions  for the students and aspirants of Chemistry12th.pptxOrganic Name Reactions  for the students and aspirants of Chemistry12th.pptx
Organic Name Reactions for the students and aspirants of Chemistry12th.pptxVS Mahajan Coaching Centre
 
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
 
Painted Grey Ware.pptx, PGW Culture of India
Painted Grey Ware.pptx, PGW Culture of IndiaPainted Grey Ware.pptx, PGW Culture of India
Painted Grey Ware.pptx, PGW Culture of IndiaVirag Sontakke
 
Full Stack Web Development Course for Beginners
Full Stack Web Development Course  for BeginnersFull Stack Web Development Course  for Beginners
Full Stack Web Development Course for BeginnersSabitha Banu
 
What is Model Inheritance in Odoo 17 ERP
What is Model Inheritance in Odoo 17 ERPWhat is Model Inheritance in Odoo 17 ERP
What is Model Inheritance in Odoo 17 ERPCeline George
 
“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
 
CELL CYCLE Division Science 8 quarter IV.pptx
CELL CYCLE Division Science 8 quarter IV.pptxCELL CYCLE Division Science 8 quarter IV.pptx
CELL CYCLE Division Science 8 quarter IV.pptxJiesonDelaCerna
 
Blooming Together_ Growing a Community Garden Worksheet.docx
Blooming Together_ Growing a Community Garden Worksheet.docxBlooming Together_ Growing a Community Garden Worksheet.docx
Blooming Together_ Growing a Community Garden Worksheet.docxUnboundStockton
 
EPANDING THE CONTENT OF AN OUTLINE using notes.pptx
EPANDING THE CONTENT OF AN OUTLINE using notes.pptxEPANDING THE CONTENT OF AN OUTLINE using notes.pptx
EPANDING THE CONTENT OF AN OUTLINE using notes.pptxRaymartEstabillo3
 

Recently uploaded (20)

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
 
Final demo Grade 9 for demo Plan dessert.pptx
Final demo Grade 9 for demo Plan dessert.pptxFinal demo Grade 9 for demo Plan dessert.pptx
Final demo Grade 9 for demo Plan dessert.pptx
 
Employee wellbeing at the workplace.pptx
Employee wellbeing at the workplace.pptxEmployee wellbeing at the workplace.pptx
Employee wellbeing at the workplace.pptx
 
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
 
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
 
call girls in Kamla Market (DELHI) 🔝 >༒9953330565🔝 genuine Escort Service 🔝✔️✔️
call girls in Kamla Market (DELHI) 🔝 >༒9953330565🔝 genuine Escort Service 🔝✔️✔️call girls in Kamla Market (DELHI) 🔝 >༒9953330565🔝 genuine Escort Service 🔝✔️✔️
call girls in Kamla Market (DELHI) 🔝 >༒9953330565🔝 genuine Escort Service 🔝✔️✔️
 
MICROBIOLOGY biochemical test detailed.pptx
MICROBIOLOGY biochemical test detailed.pptxMICROBIOLOGY biochemical test detailed.pptx
MICROBIOLOGY biochemical test detailed.pptx
 
MARGINALIZATION (Different learners in Marginalized Group
MARGINALIZATION (Different learners in Marginalized GroupMARGINALIZATION (Different learners in Marginalized Group
MARGINALIZATION (Different learners in Marginalized Group
 
How to Configure Email Server in Odoo 17
How to Configure Email Server in Odoo 17How to Configure Email Server in Odoo 17
How to Configure Email Server in Odoo 17
 
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
 
Gas measurement O2,Co2,& ph) 04/2024.pptx
Gas measurement O2,Co2,& ph) 04/2024.pptxGas measurement O2,Co2,& ph) 04/2024.pptx
Gas measurement O2,Co2,& ph) 04/2024.pptx
 
Organic Name Reactions for the students and aspirants of Chemistry12th.pptx
Organic Name Reactions  for the students and aspirants of Chemistry12th.pptxOrganic Name Reactions  for the students and aspirants of Chemistry12th.pptx
Organic Name Reactions for the students and aspirants of Chemistry12th.pptx
 
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
 
Painted Grey Ware.pptx, PGW Culture of India
Painted Grey Ware.pptx, PGW Culture of IndiaPainted Grey Ware.pptx, PGW Culture of India
Painted Grey Ware.pptx, PGW Culture of India
 
Full Stack Web Development Course for Beginners
Full Stack Web Development Course  for BeginnersFull Stack Web Development Course  for Beginners
Full Stack Web Development Course for Beginners
 
What is Model Inheritance in Odoo 17 ERP
What is Model Inheritance in Odoo 17 ERPWhat is Model Inheritance in Odoo 17 ERP
What is Model Inheritance in Odoo 17 ERP
 
“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...
 
CELL CYCLE Division Science 8 quarter IV.pptx
CELL CYCLE Division Science 8 quarter IV.pptxCELL CYCLE Division Science 8 quarter IV.pptx
CELL CYCLE Division Science 8 quarter IV.pptx
 
Blooming Together_ Growing a Community Garden Worksheet.docx
Blooming Together_ Growing a Community Garden Worksheet.docxBlooming Together_ Growing a Community Garden Worksheet.docx
Blooming Together_ Growing a Community Garden Worksheet.docx
 
EPANDING THE CONTENT OF AN OUTLINE using notes.pptx
EPANDING THE CONTENT OF AN OUTLINE using notes.pptxEPANDING THE CONTENT OF AN OUTLINE using notes.pptx
EPANDING THE CONTENT OF AN OUTLINE using notes.pptx
 

BSakthibala Global and Basic Block Code Scheduling Techniques

  • 1. B.Sakthibala, II-M.Sc (CS) Department of CS&IT Nadar Saraswathi college of arts &science.
  • 2. BASIC BLOCK SCHEDULING  Scheduling operations in a basic block consisting of machine instructions.  Solving this problem optimally is NP-complete. But in practice, a typical basic block has only a small number of highly constrained operations, so simple scheduling techniques suffice.  A simple but highly effective algorithm, called list scheduling, for this problem
  • 3. Data dependence graph  Each basic block of machine instructions by a data- dependence graph, G = (N,E), having a set of nodes N representing the operations in the machine instructions in the block and a set of directed edges E representing the data-dependence constraints among the operations.  The nodes and edges of G are constructed as follows:  1. Each operation n in N has a resource-reservation table RTn, whose value is simply the resource-reservation table associated with the operation type of n.
  • 4.
  • 5.  That is, the last instruction may be storing into the same address that the third instruction loads from. The machine model we are using allows us to store into a location one clock after we load from that location, even though the value to be loaded will not appear in a register until one clock later.  This observation explains the label 1 on the edge from the third instruction to the last. The same reasoning explains the edge and label from the first instruction to the last. The other edges with label 1 are explained by a dependence or possible dependence conditioned on the value of R7.
  • 6. List scheduling of basic blocks  The simplest approach to scheduling basic blocks involves visiting each node of the data-dependence graph in “prioritized topological order." Since there can be no cycles in a data-dependence graph, there is always at least one topological order for the nodes. However, among the possible topological orders, some may be preferable to others.
  • 7. Prioritized topological order  List scheduling does not backtrack; it schedules each node once and only once. It uses a heuristic priority function to choose among the nodes that are ready to be scheduled next.  Without resource constraints, the shortest schedule is given by the critical path, the longest path through the data-dependence graph. A metric useful as a priority function is the height of the node, which is the length of a longest path in the graph originating from the node.
  • 8.  On the other hand, if all operations are independent, then the length of the schedule is constrained by the resources available. The critical resource is the one with the largest ratio of uses to the number of units of that resource available. Operations using more critical resources may be given higher priority.  Finally, the source ordering to break ties between operations; the operation that shows up earlier in the source program should be scheduled first.
  • 10. Global code scheduling  For a machine with a moderate amount of instruction- level parallelism, schedules created by compacting individual basic blocks tend to leave many resources idle.  In order to make better use of machine resources, it is necessary to consider code-generation strategies that move instructions from one basic block to another.  Strategies that consider more than one basic block at a time are referred to as global scheduling algorithms. To do global scheduling correctly, we must consider not only data dependences but also control dependences.
  • 11. Upward code motion  Suppose we wish to move an operation from block src up a control- flow path to block dst. We assume that such a move does not violate any data dependences and that it makes paths through dst and src run faster.  If dst dominates src, and src postdominates dst, then the operation moved is executed once and only once, when it should.
  • 12. If src does not post-dominate dst  Then there exists a path that passes through dst that does not reach src. An extra operation would have been executed in this case.  If the moved operation executes “for free" i.e., it uses only resources that otherwise would be idle, then this move has no cost. It is beneficial only if the control flow reaches src.
  • 13. If dst does not dominate src  Then there exists a path that reaches src without first going through dst.  We need to insert copies of the moved operation along such paths.  We place copies of the operation along basic blocks that form a cut set separating the entry block from src
  • 14. Downward code motion  Suppose we are interested in moving an operation from block src down a control flow path to block dst. We can reason about such code motion in the same way as above.  If src does not dominate dst  If dst does not post-dominate src
  • 15. Updating Data Dependences  code motion can change the data dependence relations between operations. Thus data dependences must be updated after each code movement.
  • 16. Global scheduling Algorithm  we should aim to make the frequently executed paths run faster while possibly making the less frequent paths run slower.  There are a number of techniques a compiler can use to estimate execution frequencies.  It is reasonable to assume that instructions in the innermost loops are executed more often than code in outer loops, and that branches that go backward are more likely to be taken than not taken.
  • 17. Region-Based Scheduling  We now describe a straightforward global scheduler that supports the two easiest forms of code motion: 1. Moving operations up to control-equivalent basic blocks, and 2. Moving operations speculatively up one branch to a dominating predecessor.
  • 18. Advanced code motion Techniques  If our target machine is statically scheduled and has plenty of instruction-level parallelism, we may need a more aggressive algorithm.  To facilitate the extensions below, we can add new basic blocks along control- flow edges originating from blocks with more than one predecessor. These basic blocks will be eliminated at the end of code scheduling if they are empty.
  • 19. Interaction with dynamic schedulers  A dynamic scheduler has the advantage that it can create new schedules according to the run-time conditions, without having to encode all these possible schedules ahead of time.  If a target machine has a dynamic scheduler, the static scheduler's primary function is to ensure that instructions with high latency are fetched early so that the dynamic scheduler can issue them as early as possible.
  • 20.  If dynamic scheduling is not available on the target machine, the static scheduler must be conservative and separate every data-dependent pair of operations by the minimum delay.  If dynamic scheduling is available, however, the compiler only needs to place the data-dependent operations in the correct order to ensure program correctness.