This document discusses basic blocks and control flow graphs. It defines a basic block as a sequence of consecutive instructions that will always execute in sequence without branching. It presents an algorithm to construct basic blocks from three-address code by identifying leader statements. An example is provided to demonstrate partitioning code into two basic blocks. Control flow graphs are defined as representing the control flow and basic blocks as nodes connected by edges. Several local transformations that can be performed on basic blocks are described such as common subexpression elimination, dead code elimination, and renaming temporary variables.
Directed Acyclic Graph Representation of basic blocks is the most important topic of compiler design.This will help for student studying in master degree in computer science.
Syntax-Directed Translation: Syntax-Directed Definitions, Evaluation Orders for SDD's, Applications of Syntax-Directed Translation, Syntax-Directed Translation Schemes, and Implementing L-Attributed SDD's. Intermediate-Code Generation: Variants of Syntax Trees, Three-Address Code, Types and Declarations, Type Checking, Control Flow, Back patching, Switch-Statements
Directed Acyclic Graph Representation of basic blocks is the most important topic of compiler design.This will help for student studying in master degree in computer science.
Syntax-Directed Translation: Syntax-Directed Definitions, Evaluation Orders for SDD's, Applications of Syntax-Directed Translation, Syntax-Directed Translation Schemes, and Implementing L-Attributed SDD's. Intermediate-Code Generation: Variants of Syntax Trees, Three-Address Code, Types and Declarations, Type Checking, Control Flow, Back patching, Switch-Statements
This produced by straight forward compiling algorithms made to run faster or less space or both. This improvement is achieved by program transformations that are traditionally called optimizations.compiler that apply-code improving transformation are called optimizing compilers.
Palestine last event orientationfvgnh .pptxRaedMohamed3
An EFL lesson about the current events in Palestine. It is intended to be for intermediate students who wish to increase their listening skills through a short lesson in power point.
Unit 8 - Information and Communication Technology (Paper I).pdfThiyagu K
This slides describes the basic concepts of ICT, basics of Email, Emerging Technology and Digital Initiatives in Education. This presentations aligns with the UGC Paper I syllabus.
Ethnobotany and Ethnopharmacology:
Ethnobotany in herbal drug evaluation,
Impact of Ethnobotany in traditional medicine,
New development in herbals,
Bio-prospecting tools for drug discovery,
Role of Ethnopharmacology in drug evaluation,
Reverse Pharmacology.
2024.06.01 Introducing a competency framework for languag learning materials ...Sandy Millin
http://sandymillin.wordpress.com/iateflwebinar2024
Published classroom materials form the basis of syllabuses, drive teacher professional development, and have a potentially huge influence on learners, teachers and education systems. All teachers also create their own materials, whether a few sentences on a blackboard, a highly-structured fully-realised online course, or anything in between. Despite this, the knowledge and skills needed to create effective language learning materials are rarely part of teacher training, and are mostly learnt by trial and error.
Knowledge and skills frameworks, generally called competency frameworks, for ELT teachers, trainers and managers have existed for a few years now. However, until I created one for my MA dissertation, there wasn’t one drawing together what we need to know and do to be able to effectively produce language learning materials.
This webinar will introduce you to my framework, highlighting the key competencies I identified from my research. It will also show how anybody involved in language teaching (any language, not just English!), teacher training, managing schools or developing language learning materials can benefit from using the framework.
The Roman Empire A Historical Colossus.pdfkaushalkr1407
The Roman Empire, a vast and enduring power, stands as one of history's most remarkable civilizations, leaving an indelible imprint on the world. It emerged from the Roman Republic, transitioning into an imperial powerhouse under the leadership of Augustus Caesar in 27 BCE. This transformation marked the beginning of an era defined by unprecedented territorial expansion, architectural marvels, and profound cultural influence.
The empire's roots lie in the city of Rome, founded, according to legend, by Romulus in 753 BCE. Over centuries, Rome evolved from a small settlement to a formidable republic, characterized by a complex political system with elected officials and checks on power. However, internal strife, class conflicts, and military ambitions paved the way for the end of the Republic. Julius Caesar’s dictatorship and subsequent assassination in 44 BCE created a power vacuum, leading to a civil war. Octavian, later Augustus, emerged victorious, heralding the Roman Empire’s birth.
Under Augustus, the empire experienced the Pax Romana, a 200-year period of relative peace and stability. Augustus reformed the military, established efficient administrative systems, and initiated grand construction projects. The empire's borders expanded, encompassing territories from Britain to Egypt and from Spain to the Euphrates. Roman legions, renowned for their discipline and engineering prowess, secured and maintained these vast territories, building roads, fortifications, and cities that facilitated control and integration.
The Roman Empire’s society was hierarchical, with a rigid class system. At the top were the patricians, wealthy elites who held significant political power. Below them were the plebeians, free citizens with limited political influence, and the vast numbers of slaves who formed the backbone of the economy. The family unit was central, governed by the paterfamilias, the male head who held absolute authority.
Culturally, the Romans were eclectic, absorbing and adapting elements from the civilizations they encountered, particularly the Greeks. Roman art, literature, and philosophy reflected this synthesis, creating a rich cultural tapestry. Latin, the Roman language, became the lingua franca of the Western world, influencing numerous modern languages.
Roman architecture and engineering achievements were monumental. They perfected the arch, vault, and dome, constructing enduring structures like the Colosseum, Pantheon, and aqueducts. These engineering marvels not only showcased Roman ingenuity but also served practical purposes, from public entertainment to water supply.
Operation “Blue Star” is the only event in the history of Independent India where the state went into war with its own people. Even after about 40 years it is not clear if it was culmination of states anger over people of the region, a political game of power or start of dictatorial chapter in the democratic setup.
The people of Punjab felt alienated from main stream due to denial of their just demands during a long democratic struggle since independence. As it happen all over the word, it led to militant struggle with great loss of lives of military, police and civilian personnel. Killing of Indira Gandhi and massacre of innocent Sikhs in Delhi and other India cities was also associated with this movement.
Synthetic Fiber Construction in lab .pptxPavel ( NSTU)
Synthetic fiber production is a fascinating and complex field that blends chemistry, engineering, and environmental science. By understanding these aspects, students can gain a comprehensive view of synthetic fiber production, its impact on society and the environment, and the potential for future innovations. Synthetic fibers play a crucial role in modern society, impacting various aspects of daily life, industry, and the environment. ynthetic fibers are integral to modern life, offering a range of benefits from cost-effectiveness and versatility to innovative applications and performance characteristics. While they pose environmental challenges, ongoing research and development aim to create more sustainable and eco-friendly alternatives. Understanding the importance of synthetic fibers helps in appreciating their role in the economy, industry, and daily life, while also emphasizing the need for sustainable practices and innovation.
How to Create Map Views in the Odoo 17 ERPCeline George
The map views are useful for providing a geographical representation of data. They allow users to visualize and analyze the data in a more intuitive manner.
1. BASIC BLOCKS AND CONTROL
FLOW GRAPHS
Presented By:
Tilak Poudel
Nepathya College
6th sem
2075/08/16/01
2. Basic Blocks and Control Flow Graphs
Basic Blocks
Introduction:
■ A basic block is a sequence of consecutive instructions which are
always executed in sequence without halt or possibilty of branching.
■ The basic block doesnot have any jump statements among them.
3. Basic Blocks and Control Flow Graphs
Basic Blocks
■ When the first instruction is executed , all the instructions in the same basic block will be
executed in their sequence of appearance without losing the flow control from the program.
4. Basic Blocks Construction Algorithm
■ Input: A sequence of three-address statements.
■ Output: A list of basic blocks with each three-address statement in exactly one
block.
5. Basic Blocks Construction Algorithm
1. Determine the set of leaders,
a. The first statement is the leader.
b. Any statement that is the target of a conditional or goto is a leader.
c. Any statement that immediately follows conditional or goto is a leader.
2. For each leader, its basic block consist of the leader and all statements up to but
not including the next leader or the end of the program
6. Basic Blocks Construction Example
Consider the following three address code statements .Compute the basic blocks.
1) PROD = 0
2) I = 1
3) T2=addr(A)-4
4) T4 =addr(B)-4
5) T1 =4*I
6) T3= T2[T1]
7) T5 = T4[T1]
8) T6 =T3*T5
9) PROD =PROD + T6
10) I =I+1
11) IF I<= 20 GOTO (5)
7. Basic Blocks Construction Example
Solution:
■ Because first statement is a leader ,so –
PROD =0 is a leader.
■ Because the target statement of conditional or unconditional goto statement is a
leader, so-
T1 =4*I is also a leader
8. Basic Blocks Construction Example
So the given code can be portioned in to 2 blocks as :
B1:
B2:
PROD = 0
I = 1
T2=addr(A)-4
T4 =addr(B)-4
T1 =4*I
T3= T2[T1]
T5 = T4[T1]
T6 =T3*T5
PROD =PROD + T6
I =I+1
IF I<= 20 GOTO B2
9. Basic Blocks and Control Flow Graphs
Flow Graphs
Introduction:
■ A flow graph is a graphical representation of a sequence of instructions with
control flow edges.
■ A flow graph can be defined at the intermediate code level or target code level.
■ The nodes of flow graphs are the basic blocks and flow-of-control to immediately
follow node connected by directed arrow.
10. Flow Graphs
Points to remember:
■ The basic blocks are the nodes to the flow graph .
■ The block whose leader is the first statement is called
initial block.
■ There is a directed edge from block B1 to B2 if B2
immediately follows B1 in the given sequence
■ Then we say that B1 is the predecessor of B2.
11. Flow Graphs
The flow graph for the above three address code is given below:
B1:
B2:
PROD = 0
I = 1
T2=addr(A)-4
T4 =addr(B)-4
T1 =4*I
T3= T2[T1]
T5 = T4[T1]
T6 =T3*T5
PROD =PROD + T6
I =I+1
IF I<= 20 GOTO B2
12. Equivalence of Basic Blocks
■ Two basic blocks are (semantically) equivalent if they compute the same set of
expressions
Transformation:
a := c*a a := c*a
b := 0 b := 0
■ Blocks are equivalent, assuming t1 and t2 are dead: no longer used (no longer live)
b := 0
t1 := a + b
t2 := c * t1
a := t2
a := c * a
b := 0
13. Transformations on Basic Blocks
■ A code-improving transformation is a code optimization to improve speed or
reduce code size.
■ Global transformations are performed across basic blocks.
■ Local transformations are only performed on single basic blocks.
■ Transformations must be safe and preserve the meaning of the code .
■ A local transformation is safe if the transformed basic block is guaranteed to be
equivalent to its original form
14. Transformations on Basic Blocks
Some local transformation are:
LocalTransformation
Common-
Subexpression
Elimination
Dead Code Elimination
Renaming Temporary
Variables
Interchange of
Statements
Algebraic
Transformations
15. Common-Subexpression Elimination
■ Remove redundant computations
■ 2nd and 4th:compute same expression in fig:1(a)
■ Look at 1st and 3rd in fig:1(b) :b is redefine in 2nd therefore different in3rd, not the same
expression
fig:1(a) fig:1(b)
a := b + c
b := a - d
c := b + c
d := a - d
a := b + c
b := a - d
c := b + c
d := b
t1 := b * c
t2 := a - t1
t3 := b * c
t4 := t2 + t3
t1 := b * c
t2 := a - t1
t4 := t2 + t1
16. Dead Code Elimination
■ Remove unused statements
Assuming a is dead (not used)
Remove unreachable code
b := a + 1
a := b + c
…
b := a + 1
…
goto L2
b := x + y
…
17. Renaming Temporary Variables
■ Temporary variables that are dead at the end of a block can be safely renamed.
■ The basic block is transforms into an equivalent block in which each statement that
defines a temporary defines a new temporary.
■ Such a basic block is called normal-form block or simple block.
Normal-form block
■ Note that normal-form blocks permit all statement interchanges that are possible.
t1 := b + c
t2 := a - t1
t1 := t1 * d
d := t2 + t1
t1 := b + c
t2 := a - t1
t3 := t1 * d
d := t2 + t3
18. Interchange of Statements
■ Independent statements can be reordered without effecting the value of block to
make its optimal use.
■ Note that normal-form blocks permit all statement interchanges that are possible
t1 := b + c
t2 := a - t1
t3 := t1 * d
d := t2 + t3
t1 := b + c
t3 := t1 * d
t2 := a - t1
d := t2 + t3
19. Algebraic Transformations
■ Change arithmetic operations to transform blocks to algebraic equivalent forms.
■ Simplify expression or replace expensive expressions by cheaper ones.
■ In statement 3,usually require a function call
■ Transforms to simple and equivalent statement
t1 := a - a
t2 := b + t1
t3 := t2 **2
t1 := 0
t2 := b
t3 := t2 * t2