SlideShare a Scribd company logo
Code Scheduling
Constraints
P.Abinaya
Msc(cs)
 Code scheduling is a form of program optimization
that applies to the machine code that is produced by
the code generator. Code scheduling is subject to three
kinds of constraints:
 Data-dependence constraints. The operations in the
optimized program must produce the same results as
the corresponding ones in the original program.
 Resource constraints. The schedule must not
oversubscribe the resources on the machine.
 True dependence: read after write. If a write is
followed by a read of the same location, the read
depends on the value written; such a dependence
is known as a true
 Antidependence: write after read. If a read is
followed by a write to the same location, we say
that there is an antidependence from the read to
the write.
 To check if two memory accesses share a data
dependence, we only need to tell if they can refer to
the same location; we do not need to know which
location is being accessed.
 For example, we can tell that the two accesses *p and
O p ) + 4 cannot refer to the same location, even
though we may not know what p points to. Data
dependence is generally undecidable at compile time.
The compiler must assume that operations may refer
to the same location unless it can prove otherwise.
 machine-independent intermediate rep-resentation of
the source program uses an unbounded number of
pseudoregisters to represent variables that can be
allocated to registers. These variables include scalar
variables in the source program that cannot be
referred to by any other names, as well as temporary
variables that are generated by the compiler to hold
the partial results in expressions. Unlike memory
locations, registers are uniquely named. Thus precise
data-dependence constraints can be generated for
register accesses easily.
 If registers are allocated before scheduling, the
resulting code tends to have many storage
dependences that limit code scheduling. On the other
hand, if code is scheduled before register allocation,
 Scheduling operations within a basic block is relatively
easy because all the instructions are guaranteed to
execute once control flow reaches the beginning of the
block. Instructions in a basic block can be reordered
arbitrarily, as long as all the data dependences are
satisfied. Unfortunately, basic blocks,
 especially in nonnumeric programs, are typically very
small; on average,
 there are only about five instructions in a basic block.
In addition, operations in the same block are often
highly related and thus have little parallelism.
 Memory loads are one type of instruction that can
benefit greatly from specula-tive execution. Memory
loads are quite common, of course.
 They have relatively long execution latencies,
addresses used in the loads are commonly available in
advance, and the result can be stored in a new
temporary variable without destroying the value of any
other variable.
 Many machines can be represented using the
following simple model. A machine M = {R,T), consists
of
 :A set of operation types T, such as loads, stores,
arithmetic operations, and so on.
 A vector R = [n, r2,... ] representing hardware
resources, where r« is the number of units available of
the ith kind of resource. Examples of typical resource
types include: memory access units, ALU's, and
floating-point functional units.
Compiler Design

More Related Content

PPTX
Code scheduling constraints
DOCX
Mca5010 web technologies
DOCX
Mca5010 web technologies
PPT
VWBPE 2020 - Overcoming LSL Limitations in Second Life
PPTX
Parallel programming model
PDF
Productivity tools
PPTX
Parallel programming model
DOCX
Bnt403 web technologies
Code scheduling constraints
Mca5010 web technologies
Mca5010 web technologies
VWBPE 2020 - Overcoming LSL Limitations in Second Life
Parallel programming model
Productivity tools
Parallel programming model
Bnt403 web technologies

Similar to Compiler Design (20)

PPTX
AABBCCDDOPERATING_SYSTEM_PARA_SUBIR.pptx
PPTX
compiler design
PPTX
Basic Block Scheduling
PPT
COMPILER_DESIGN_CLASS 2.ppt
PPTX
COMPILER_DESIGN_CLASS 1.pptx
PPT
PRESENTATION ON DATA STRUCTURE AND THEIR TYPE
PPT
456589.-Compiler-Design-Code-Generation (1).ppt
PPTX
Constraint Programming in Compiler Optimization: Lessons Learned
PPT
456589.-Compiler-Design-Code-Generation (1).ppt
PPT
Code Generations - 1 compiler design.ppt
PPT
Embedded systems programming.ppt
PPT
ERTS UNIT 3.ppt
PDF
Design of Parallel and HPC, Lecture: Memory Models
PPTX
Instruction-Level Parallelism and Its Exploitation.pptx
PDF
Enscape 3D 3.6.6 License Key Crack Full Version
PDF
Wondershare Filmora Crack 12.0.10 With Latest 2025
PDF
Wondershare UniConverter Crack Download Latest 2025
PDF
Skype 125.0.201 Crack key Free Download
PPT
Code_generatio.lk,jhgfdcxzcvgfhjkmnjhgfcxvfghjmh
PDF
Cs8493 unit 3
AABBCCDDOPERATING_SYSTEM_PARA_SUBIR.pptx
compiler design
Basic Block Scheduling
COMPILER_DESIGN_CLASS 2.ppt
COMPILER_DESIGN_CLASS 1.pptx
PRESENTATION ON DATA STRUCTURE AND THEIR TYPE
456589.-Compiler-Design-Code-Generation (1).ppt
Constraint Programming in Compiler Optimization: Lessons Learned
456589.-Compiler-Design-Code-Generation (1).ppt
Code Generations - 1 compiler design.ppt
Embedded systems programming.ppt
ERTS UNIT 3.ppt
Design of Parallel and HPC, Lecture: Memory Models
Instruction-Level Parallelism and Its Exploitation.pptx
Enscape 3D 3.6.6 License Key Crack Full Version
Wondershare Filmora Crack 12.0.10 With Latest 2025
Wondershare UniConverter Crack Download Latest 2025
Skype 125.0.201 Crack key Free Download
Code_generatio.lk,jhgfdcxzcvgfhjkmnjhgfcxvfghjmh
Cs8493 unit 3
Ad

More from sweetysweety8 (20)

PPTX
Artificial neural network
PPTX
Compiler Design
PPTX
Software engineering
PPTX
Software engineering
PPTX
WEB PROGRAMMING ANALYSIS
PPTX
Software engineering
PPTX
Software engineering
PPTX
WEB PROGRAMMING ANALYSIS
PPTX
WEB PROGRAMMING
PPTX
Bigdata
PPTX
BIG DATA ANALYTICS
PPTX
BIG DATA ANALYTICS
PPTX
Compiler Design
PPTX
WEB PROGRAMMING
PPTX
BIG DATA ANALYTICS
PPT
Data mining
PPTX
Operating System
PPTX
Relational Database Management System
PPTX
Relational Database Management System
PPTX
Relational Database Management System
Artificial neural network
Compiler Design
Software engineering
Software engineering
WEB PROGRAMMING ANALYSIS
Software engineering
Software engineering
WEB PROGRAMMING ANALYSIS
WEB PROGRAMMING
Bigdata
BIG DATA ANALYTICS
BIG DATA ANALYTICS
Compiler Design
WEB PROGRAMMING
BIG DATA ANALYTICS
Data mining
Operating System
Relational Database Management System
Relational Database Management System
Relational Database Management System
Ad

Recently uploaded (20)

PPTX
Tour Presentation Educational Activity.pptx
PPTX
chapter8-180915055454bycuufucdghrwtrt.pptx
PPTX
Tablets And Capsule Preformulation Of Paracetamol
PDF
COLEAD A2F approach and Theory of Change
PPTX
_ISO_Presentation_ISO 9001 and 45001.pptx
PDF
PM Narendra Modi's speech from Red Fort on 79th Independence Day.pdf
PPTX
Intro to ISO 9001 2015.pptx wareness raising
PPTX
PHIL.-ASTRONOMY-AND-NAVIGATION of ..pptx
PPTX
lesson6-211001025531lesson plan ppt.pptx
PPTX
An Unlikely Response 08 10 2025.pptx
PDF
Tunisia's Founding Father(s) Pitch-Deck 2022.pdf
PPTX
The Effect of Human Resource Management Practice on Organizational Performanc...
DOC
LSTM毕业证学历认证,利物浦大学毕业证学历认证怎么认证
PDF
MODULE 3 BASIC SECURITY DUTIES AND ROLES.pdf
PPTX
fundraisepro pitch deck elegant and modern
PPTX
ANICK 6 BIRTHDAY....................................................
PPTX
PurpoaiveCommunication for students 02.pptx
PDF
Nykaa-Strategy-Case-Fixing-Retention-UX-and-D2C-Engagement (1).pdf
DOCX
ENGLISH PROJECT FOR BINOD BIHARI MAHTO KOYLANCHAL UNIVERSITY
PPTX
FINAL TEST 3C_OCTAVIA RAMADHANI SANTOSO-1.pptx
Tour Presentation Educational Activity.pptx
chapter8-180915055454bycuufucdghrwtrt.pptx
Tablets And Capsule Preformulation Of Paracetamol
COLEAD A2F approach and Theory of Change
_ISO_Presentation_ISO 9001 and 45001.pptx
PM Narendra Modi's speech from Red Fort on 79th Independence Day.pdf
Intro to ISO 9001 2015.pptx wareness raising
PHIL.-ASTRONOMY-AND-NAVIGATION of ..pptx
lesson6-211001025531lesson plan ppt.pptx
An Unlikely Response 08 10 2025.pptx
Tunisia's Founding Father(s) Pitch-Deck 2022.pdf
The Effect of Human Resource Management Practice on Organizational Performanc...
LSTM毕业证学历认证,利物浦大学毕业证学历认证怎么认证
MODULE 3 BASIC SECURITY DUTIES AND ROLES.pdf
fundraisepro pitch deck elegant and modern
ANICK 6 BIRTHDAY....................................................
PurpoaiveCommunication for students 02.pptx
Nykaa-Strategy-Case-Fixing-Retention-UX-and-D2C-Engagement (1).pdf
ENGLISH PROJECT FOR BINOD BIHARI MAHTO KOYLANCHAL UNIVERSITY
FINAL TEST 3C_OCTAVIA RAMADHANI SANTOSO-1.pptx

Compiler Design

  • 2.  Code scheduling is a form of program optimization that applies to the machine code that is produced by the code generator. Code scheduling is subject to three kinds of constraints:  Data-dependence constraints. The operations in the optimized program must produce the same results as the corresponding ones in the original program.  Resource constraints. The schedule must not oversubscribe the resources on the machine.
  • 3.  True dependence: read after write. If a write is followed by a read of the same location, the read depends on the value written; such a dependence is known as a true  Antidependence: write after read. If a read is followed by a write to the same location, we say that there is an antidependence from the read to the write.
  • 4.  To check if two memory accesses share a data dependence, we only need to tell if they can refer to the same location; we do not need to know which location is being accessed.  For example, we can tell that the two accesses *p and O p ) + 4 cannot refer to the same location, even though we may not know what p points to. Data dependence is generally undecidable at compile time. The compiler must assume that operations may refer to the same location unless it can prove otherwise.
  • 5.  machine-independent intermediate rep-resentation of the source program uses an unbounded number of pseudoregisters to represent variables that can be allocated to registers. These variables include scalar variables in the source program that cannot be referred to by any other names, as well as temporary variables that are generated by the compiler to hold the partial results in expressions. Unlike memory locations, registers are uniquely named. Thus precise data-dependence constraints can be generated for register accesses easily.
  • 6.  If registers are allocated before scheduling, the resulting code tends to have many storage dependences that limit code scheduling. On the other hand, if code is scheduled before register allocation,
  • 7.  Scheduling operations within a basic block is relatively easy because all the instructions are guaranteed to execute once control flow reaches the beginning of the block. Instructions in a basic block can be reordered arbitrarily, as long as all the data dependences are satisfied. Unfortunately, basic blocks,  especially in nonnumeric programs, are typically very small; on average,  there are only about five instructions in a basic block. In addition, operations in the same block are often highly related and thus have little parallelism.
  • 8.  Memory loads are one type of instruction that can benefit greatly from specula-tive execution. Memory loads are quite common, of course.  They have relatively long execution latencies, addresses used in the loads are commonly available in advance, and the result can be stored in a new temporary variable without destroying the value of any other variable.
  • 9.  Many machines can be represented using the following simple model. A machine M = {R,T), consists of  :A set of operation types T, such as loads, stores, arithmetic operations, and so on.  A vector R = [n, r2,... ] representing hardware resources, where r« is the number of units available of the ith kind of resource. Examples of typical resource types include: memory access units, ALU's, and floating-point functional units.