0% found this document useful (0 votes)
46 views19 pages

IA3-CTCD QB - COE-General 20.9.24 New

question bank

Uploaded by

Ranjit47 H
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
46 views19 pages

IA3-CTCD QB - COE-General 20.9.24 New

question bank

Uploaded by

Ranjit47 H
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 19

NAME OF THE B.

E CSE & ALLIED


PROGRAMME
YEAR III
SEMESTER V
REGULATIONS 2022
COURSE CODE CS2502 / CB2502 / AM2501 / AD2501 / IT2502/ CZ2501
COURSE NAME COMPUTING THEORY AND COMPILER DESIGN

FACULTY NAME (Prepared Dr.N.Kandavel Contact 9791882299


by)
NAME OF SUBJECT Dr.S.Pavithra Contact 9790968657
EXPERT(Verified by)

REVISED BLOOMS TAXONOMY(RBT)

L1- Remembering L2 - Understanding L3 - Applying L4 - Analyzing L5 - Evaluating L6 – Creating

Course Objectives:
COSNO Course Objectives
1. To understand foundations of computation and construct models of regular expressions
2. To design context free grammar, pushdown Automata and Turing machine
3. To understand intermediate code generation
4. To understand run-time environment and implement code generator
5. To learn to implement code optimization

Course Outcomes:
On Completion of the course the students will be able to
CONO Course Outcomes RBTLevel
1. Construct Finite Automata and write regular expressions for any L2
pattern
2. Design context free grammar, pushdown Automata and Turing L3
Machine computational functions
3. Understand semantic rules and intermediate code generation L2
4. Understand the run-time environment and implement code generation L2
5. Apply code optimization techniques L3
UNIT TITLE
I FORMAL_LANGUAGE_AND_REGULAR_EXPRESSIONS

SNO QUESTIONS RBT CO MARKS TOPIC IMAGES

L1 CO1 2 RE
1 Define a regular expression.

L1 CO1 2 Finite
2 What is a finite automaton? Automat
a
CO1 2 DFA,
3 Distinguish between DFA and NFA. L2
NFA

What is the pumping lemma for regular CO1 2 Pumping


4 L2
languages? Lemma

5 How is the epsilon transition represented L2 CO1 2 NFA


in an NFA?
What is the difference between an CO1 2 Languag
6 L2
alphabet and a string in formal language es
theory?
L3 CO1 2 Languag
es, RE
7 Give an example of a regular expression
and the corresponding language.

Define the term "lexical analysis"n


CO1 2 Lexical
8 L1
compiler design. Analysis
Design a DFA for the L3 CO1 2 DFA
language L={w∣w contains an even
9 number of 1s} ove r Σ={0,1}.

L3 CO1 2 Conversi
on of RE
Construct an €NFA for th regular to NFA
10
expression (a∣b)∗ab.

11 Give the regular expression for the L3 CO1 2


RE
language consisting of all strings over
Σ={a,b} that
end with ab.

Design a DFA for the language L3 CO1 2 DFA


12 L={w∣w contains the substring 010}

over Σ={0,1}.
Convert the NFA for the regular L3 CO1 2 NFA
13
expression a(b∣c)∗d to a DFA. to
DF
A
Show the transition table for a DFA L3 CO1 2 DFA
14 that recognizes the language
L={w∣w starts with 1} over Σ={0,1}.
Design a DFA for the language L3 CO1 2 DFA
15 L={w∣w contains no consecutive 1s}

over Σ={0,1}.
16 Draw the transition diagram for an NFA L3 CO1 2 NFA
that accepts strings over Σ={a,b} ending
with ba.
Design a DFA for the language L3 CO1 2 DFA
17 L={w∣w contains at most one 1}

over Σ={0,1}.
CO1 2 RE
18 What is the role of regular expressions L2
in pattern matching?

19 Define an epsilon closure in the context L1 CO1 2 NFA


of NFA.
20 What is the function of lex tool? L1 CO1 2 Lex
Tool
Construct the NFA transition diagram L3 CO1 12 RE
21 from the given below regular expression

(0+1)*+(0+1)*
Construct the NFA transition diagram L3 CO1 12 RE
22 from the given below regular expression

a*ba+b*ab
To find equivalent DFA from the below L3 CO1 12 DFA
NFA transition diagram
a,b
23 a b

Construct a DFA for the L3 CO1 12 DFA


24 language L={w∣w does not contain the
substring 00} over Σ={0,1}. Show the
transition table and diagram.
Convert the following NFA to a L3 CO1 12 NFA
25 DFA: Q={q0,q1,q2}, Σ={a,b},
δ(q0,a)={q0,q1}, δ(
q0,b)={q0}, δ(q1,b)={q2}, q0 is the start
stat e, q2 is the accepting state.

Convert the following NFA-€ L3 CO1 12 NFA-€


transition diagram to NFA 0 1 2
26
€ €

Construct the minimal DFA for the L3 CO1 12 DFA


27 language L={w∣w has an even number of
0s and an od d number of 1s} over
Σ={0,1}.
Convert the NFA given by the L3 CO1 12 DFA
transition table below to an equivalent
DFA
28

Convert the language using L3 CO1 12 Pump


29
pumping Lemma A={an bn/n≥0} ing
Lem
ma
Convert the language using L3 CO1 12 Pump
30
pumping Lemma A={an b2n/n≥0} ing
Lem
ma
Given the regular expression a(a∣b)∗ b, L3 CO1 16 RE
31 construct the corresponding NFA and
convert it to a DFA.
Design a DFA for the language L = { w L3 CO1 16 DFA
32 contains an odd number of a's and an even
number of b's} over Σ={a,b}.
L3 CO1 16 RE
33 Convert the following regular expression
to a NFA: (01∣10)∗.

Given the regular expression (a∣b)∗abb, L3 CO1 16 RE


34 construct the NFA and then convert it to
the equivalent DFA.
35 L3 CO1 16 NFA
Draw a transition diagram for an NFA
that accept the string over{a,b} ending
with abb.
36 L3 CO1 16 NFA
Draw a transition diagram for an NFA
that accept the string over{a,b} ending
with abb to convert DFA
37 L3 CO1 16 NFA 0,1
Construct DFA equivalent to the NFA
given below 0 1
q q q
0 1 2

Given the regular expression L6 CO1 16 RE


(0+1)*(00+11)(0+1)*, construct the
38 corresponding NFA, convert it to an
equivalent DFA, and then minimize
the DFA. Show all steps in detail with
diagrams.
Design a DFA equivalent to the NFA

M=({p,q,r,s},{0,1}s,p,{s}) where is state 0 1


defined in the following table L6 CO1 16 DFA P {p,q} {p}
Q {r} {r}
39 R {s} Ø
*s {s} {s}
Design a DFA equivalent to the given L6 CO1 16 DFA
NFA € transition table
St a b c €
40 ate
P {p} {q} {r} Ø
Q {q} {r} Ø {p}
*r {r} Ø {p} {q}
Convert the regular expression (0∣1)∗011 L3 CO1 16 RE
41
to an equivalent DFA. Show all
intermediate steps.

UNIT TITLE
II CONTEXT_FREE_GRAMMARS_AND_PARSING

SNO QUESTIONS RBT CO MARKS TOPIC IMAGES

What is a context-free grammar (CFG)? L1 CO2 2 CFG


1

Define a derivation in the context of CFGs L1 CO2 2 Derivation


2 of CFG

CO2 2 Parse
3 What is a parse tree? L1
tree

Explain ambiguity in a grammar CO2 2 Ambiguou


4 L2
s grammar
5 What is an LL(k) grammar? L1 CO2 2 LL(k)
grammar
Define LL(1) parsing CO2 2 LL(1)
6 L1
parsing
L1 CO2 2 bottom-up
7 What is bottom-up parsing? parsing

What is handle pruning in the context of CO2 2 handle


8 L1
bottom-up parsing? pruning
9 L1 CO2 2 LR
What is an LR grammar? grammar

10 Explain LALR parsing. L2 CO2 2 LALR

11 How do you parse ambiguous grammars? L2 CO2 2


Ambiguou
s grammar
12 What is YACC? L1 CO2 2
YACC

13 Define a pushdown automaton (PDA). L1 CO2 2


PDA

14 What is the pumping lemma for context-free L1 CO2 2


pumping
languages?
lemma

15 What is a Turing machine? L1 CO2 2


Turing
machine
16 What does undecidability refer to in L2 CO2 2
undecidabi
computational theory?
lity
17 What is the Halting Problem? L1 CO2 2
Halting

18 What is the significance of the pumping L2 CO2 2


pumping
lemma for regular languages?
lemma

19 What does it mean if a grammar is not L2 CO2 2 LL(1)


LL(1)?
parsing
20 What are the key differences between L2 CO2 2 LL(1),LR
LL(1) and LR(0) parsing? (0)
21 i) Design a PDA that accepts the language L3 CO2 8
PDA
{an bn cm | n ≥ 1, m≥ 1}.
ii) Given the CFG:
L3 4
S → aS | b CFG
Derive the string aaab and list the steps.

22 i) Show the leftmost and rightmost L3 CO2 8


LMD&R
derivations for the string aab using the MD
grammar:
S → aSb | ab 4 LL(1)
ii) Define the FIRST and FOLLOW sets for
parser
the grammar: L3
S → aB | b
B→ε|c

23 i)Construct an LL(1) parsing table for the L4 CO2 8


LL(1)
grammar: parser
S → aAB | b
A→a|ε
B→b LMD&RM
4 D
ii)Discuss leftmost and rightmost L3
derivations with examples.
24 i)Construct the LR(0) parsing table for the L4 CO2 8
LR(0)
following grammar:
parser
S→AA
A→Aa|b
4 LL(1)
ii) ii)Determine if the following grammar is L3 parser
LL(1):
S → aSb | ε
25 i) Discuss leftmost and rightmost L3 CO2 8
PDA
derivations with examples.
ii)To find the FIRST() & FOLLOW() for the
following production rule: L3 4 LL(1)
E→E+T|T parser
T→T*F|F
F → (E) | id
26 i) Construct the CFG L={w ¢wR|w € (0,1)*} L4 CO2 8
CFG
ii)Is the following grammar ambiguous?
Justify your answer: 4 Ambiguous
L3
S → SS | ab | ba grammar
27 i)Given the grammar: L3 CO2 6
LL(1)
S → aAd | bBc parser
A→c|ε
B→d
Construct the LL(1) parsing table and parse L4
the string acd.
ii)Construct an SLR parsing table for the 6 SLR
grammar:
parser
S → aSb | ε
28 i)Simulate a PDA for the string aabb and L5 CO2 6
PDA
show each step.
ii) Convert the following CFG to a PDA: L6 6 CFG to
S → aSb | ε PDA

29 i)Describe the operation of a pushdown L3 CO2 6


PDA
automaton with an example.
ii) Construct the CFG equal no.of a’s and b’s 6
form by (an bn|n>=1) CFG
L6

30 L3 CO2 6
PDA
i)Design a PDA that accepts the language
{an bn | n ≥ 1}. 6
L3 Ambiguous
ii)Is the following grammar ambiguous? grammar
Justify your answer:
S → SS | ab | ba
31 Design a CFG for arithmetic expressions L4 CO2 12
CFG
involving addition, subtraction,
multiplication, and division. Show
derivations for 3 + 5 * 2.

32 Construct the LL(1) parsing table for the L5 CO2 12


LL(1)
following grammar and parse the string parser
aacbd:
S → aABd
A → ε | bA
B→c
33 Design a Turing machine that accepts the L5 CO2 12
Turing
language {0n 1n | n ≥ 1}. Explain each machine
transition.

34 Illustrate handle pruning in detail with L3 CO2 12


Handle
examples. pruning
35 Construct the SLR Parsing table and accept L4 CO2 12
SLR
the string for ‘cdd$’ for the following
grammar.
E→BB
B→cB/d
36 Construct the SLR Parsing table and accept L5 CO2 12
SLR
the string for‘abb$’ for the following
grammar.
S→AA
B→aA/b
37 Draw LL(1) parsing table for the following L4 CO2 12
LL(1)
grammar and accept the string to prove it.
parser
S→aABb
A→c/€
B→d/€
38 Find out the whether the following grammar L5 CO2 12
LL(1)
is LL (1)
parser
S→aB/€
B→bC/€
C→cS/€
39 Construct the string ‘aabbabba’ from the L6 CO2 16
CFG
given CFG:
i) Left Most Derivation
ii) Right Most Derivation
iii) Parse Tree
S→aB|bA
A→a|aS|bAA
B→b|bS|aBB
40 Provide a detailed predictive Parsing LL(1) L6 CO2 16
LL(1)
table for the following given grammar: parser
E→E+T|T
T→T*F|F
F →(E)| id
41 Analyze the given CFG: L5 CO2 16
CFG,
S → aSb | ε Ambiguous
A → aA | b grammar
Discuss its language, construct parse trees
for various strings, and determine if it is
ambiguous.

42 Construct a SLR parsing table for the L6 CO2 16


SLR
grammar: parser
S→E
E→E+T|T
T→T*F|F
F → (E) | id
Parse the string id + id * id.
43 Analyze the operation and significance of L3 CO2 16
Turing
Turing machines. machines
44 Design a PDA for the language {an bn | n ≥ L3 CO2 16
PDA
1} and stimulate its operation for aabb.

UNIT TITLE
III SYNTAX_DIRECTED_TRANSLATION_AND_INTERMEDIAT
E_CODE_GENERATION

SNO QUESTIONS RBT CO MARKS TOPIC IMAGES

What is syntax-directed translation? L1 CO3 2 SDT


1

Define S-attributed grammar L1 CO3 2 S-attributed


2 grammar

L1 CO3 2 L-
3 What is an L-attributed grammar? attributed
grammar
What is an abstract syntax tree (AST)? L1 CO3 2 AST
4

5 Explain intermediate code generation L2 CO3 2 intermediate


code
generation
How are simple statements typically CO3 2 Simple
6 L2
translated? statement
s
What are control flow statements? L1 CO3 2 control
7 flow
statements
CO3 2 context-
8 What are context-sensitive features in L1
sensitive
programming languages?
features
9 L1 CO3 2 Chomsk
What is the Chomsky hierarchy of y
languages? hierarchy
10 What is type checking? L1 CO3 2 type
checking
11 What are type conversions? L1 CO3 2
type
conversion
s
12 Explain equivalence of type expressions. L2 CO3 2 equivalence
of type
expressions

13 What is function overloading? L1 CO3 2


function
overloadin
g
14 What is operator overloading? L1 CO3 2 operator
overloading

15 What is a synthesized attribute? L1 CO3 2


synthesize
d attribute
16 What is an inherited attribute? L1 CO3 2
inherited
attribute
17 What role does type checking play in L2 CO3 2
type
preventing errors?
checking

18 Describe the role of the abstract syntax tree L2 CO3 2


abstract
in code optimization.
syntax tree

19 What is a context-sensitive language? L1 CO3 2


context-
sensitive
language
20 How do context-free grammars differ from L2 CO3 2 Chomsky
regular grammars in the Chomsky hierar
hierarchy? chy

21 i)Discuss how syntax-directed definitions L3 CO3 8


SDT
specify the translation of input strings and
the evaluation of attributes.
ii)Discuss how type equivalence is L4
determined in programming languages. 4 PL

22 i)Illustrate the construction of an S- L3 CO3 8


S-
attributed grammar with an example. attributed
ii)Describe the role of intermediate code in grammar
L4
the compilation process. intermedia
4 te code
23 i)Demonstrate the construction of an L- L3 CO3 8
L-
attributed grammar with an example. attributed
ii)Define function overloading and its use grammar
L4
in programming languages.
4 function
overloadin
g
24 i)Discuss the advantages of using abstract L3 CO3 8
abstract
syntax trees over parse trees. syntax
ii)Describe implicit and explicit type trees
L4
conversions with examples. implicit
4 and
explicit
type
25 i)Explain the process of translating control L3 CO3 8
translating
flow statements to intermediate code. control
ii)Explain the purpose of type checking in flow
L4
ensuring program correctness. statements
4 type
checking
26 i)Discuss the relationship between context- L3 CO3 8
CF,CSG
free and context-sensitive languages.
ii)Identify the four types of formal L5 Chomsky
languages in the Chomsky hierarchy and
hierarchy
provide examples. 4

27 i)Explain the role of type checking in L3 CO3 8


type
object-oriented programming. checking
ii)Discuss how ASTs are used to represent L4
the structure of source code for further
AST
processing. 4

28 i)Discuss the challenges of type L3 CO3 8


Type
conversions in strongly typed languages. conversion
ii)Explain the concept of L-attributed L4
grammars and how they differ from S-
L& S
attributed grammars. 4 attributed
grammars
29 i)Illustrate the process of function and L3 CO3 8
function
operator overloading resolution. and
ii)Describe the characteristics of S- operator
L4
attributed grammars and their significance overloadin
g
in semantic analysis. 4
S-
attributed
grammars
30 i)Explain how abstract syntax trees are L3 CO3 8 intermediate
used in optimizing intermediate code. code
ii)Discuss how syntax-directed translation L4
specifies the relationship between input
SDT
strings and their translations using grammar 4
rules and attributes.

31 i)Describe the process of syntax-directed L3 CO3


6 SDT
translation using an example.
ii)Explain the significance of intermediate L4
code optimization.
intermediate
6
code
optimization

32 i)Discuss the differences between S- L3 CO3


6 L& S
attributed and L-attributed grammars
attributed
grammars
ii)Discuss the concept of operator L4
overloading with examples. operator
6 overloadin
g
33 i)Explain how abstract syntax trees are L3 CO3
6 AST
constructed for arithmetic expressions.
ii)Describe how type conversions are L4 type
handled in different contexts.
conversion
6
s
34 i)Illustrate the translation of simple L3 CO3 intermediate
6
arithmetic expressions to intermediate code
code.
L4
ii)Discuss the importance of type checking
6 type
in statically typed languages.
checking

35 i)Discuss how context-sensitive features L3 CO3


6 CSG
affect language syntax and semantics.
ii)Describe the role of recognizers in the L4 Chomsky
Chomsky hierarchy. hierarchy
6

36 Discuss the design and implementation of L4 CO3


12 SDT
syntax-directed translators.

37 Discuss how attributed grammars are used L4 CO3 12 attributed


to specify semantic actions and attribute grammars
evaluation.
38 Illustrate the complete process of parsing L4 CO3 12 AST
and constructing an AST for a complex
expression.

39 Explain the generation of intermediate code L5 CO3 12 intermediate


for various control flow structures. code

40 Discuss the Chomsky hierarchy and its L5 CO3 12 Chomsky


implications for language recognition. hierarchy

41 Discuss the role of type checking in L5 CO3 12 type


modern programming languages. checking

42 Explain the challenges and solutions in L5 CO3 12 type


type conversions for generic programming. conversions

43 Illustrate the implementation of function CO3 12 function and


and operator overloading in a compiler. operator
overloading

44 Discuss the optimization techniques L5 CO3 12 intermediate


applied to intermediate code generation. code
generation

45 Describe how intermediate code can be L5 CO3 12 intermediate


transformed to target-specific code. code

46 Discuss the principles of syntax-directed L5 CO3 16


SDT
translation and how they are used to
implement language features in compilers.

47 Provide a detailed example of designing an L5 CO3 16


S-
S-attributed grammar for a simple attributed
programming language and demonstrate its grammar
use.

48 Develop an L-attributed grammar for a L5 CO3 16


L-
simple programming language and explain attributed
the evaluation of attributes. grammar

49 Discuss the construction and optimization L5 CO3 16


AST
of abstract syntax trees in detail.

50 Explain the process of translating high- L5 CO3 16 intermediate


level language constructs to intermediate code
code.
51 Analyze the Chomsky hierarchy and its L5 CO3 16
Chomsky
impact on formal language theory. hierarchy

52 Discuss the implementation of type L5 CO3 16


type
checking in a statically typed programming checking
language.

53 Explain type conversion mechanisms and L5 CO3 16


type
their impact on programming language conversion
design.

54 Describe the implementation of function L5 CO3 16


function
and operator overloading in object-oriented and
languages. operator
overloadin
g
55 Discuss the overall process of intermediate L5 CO3 16 intermediate
code generation and optimization. code
generation
and
optimization

UNIT TITLE
IV RUN_TIME_ENVIRONMENTS_AND_CODE_GENERATION

SNO QUESTIONS RBT CO MARKS TOPIC IMAGES

L1 CO4 2 storage
1 Define storage organization organizat
ion

What are the strategies in storage L1 CO4 2 storage


2 organization
organization?

L1 CO4 2 storage
3 Define static Allocation organizati
on
L1 CO4 2 storage
4 Define stack Allocation organizati
on
5 What is meant by Heap Allocation? L2 CO4 2 storage
organization
CO4 2 parameter
6 Define parameter passing L2
passin
g
L1 CO4 2 symbol
7 Define symbol Table
Table
What is meant by dynamic storage CO4 2 storage
8 L1
organizati
Allocation?
on
9 What are the issues in the design of code L1 CO4 2 code
generator
generator
10 Define basic blocks L1 CO4 2 basic
blocks
11 Define flow graph L1 CO4 2
flow graph

12 L2 CO4 2
Define Register descriptor Register
descriptor
13 L1 CO4 2
Define address descriptor address
descriptor
14 L1 CO4 2
What are the entries in symbol table? symbol
table
15 Define Lexical analyzer and syntax L1 CO4 2
Lexical
analysis analyzer

16 L1 CO4 2
What are the phases of compiler phases of
compiler
17 L2 CO4 2
Define code generation code
generation
18 L2 CO4 2
Define instruction selection Instruction
selection
19 L1 CO4 2
storage
What is Register Allocation
organizati
on
20 L2 CO4 2 Memor
Define Memory Management Mana
gemen
t
21 Write a simple code generator L3 CO4 12
simple
algorithm with an example code; code
generator
show how the algorithm generates
code.
22 CO4 12
What is a symbol table? What type of symbol
table
information is stored in it? Discuss the use
L4
of data structures for implementing a
symbol table.
23 L3 CO4 12
storage
Discuss in Storage allocations strategies organizati
on
24 L3 CO4 12
Parameter
Discuss in Parameter passing methods passing

25 L3 CO4 12
Explain about the storage organization in storage
organizati
Runtime Memory. on

26 L3 CO4 12
Write down the algorithm for partitioning intermedia
intermediate code into Basic block with an te code
example
27 CO4 12
Explain about the dynamic storage storage
organizati
allocation with example
on
L4
28 L3 CO4 12
code
Explain about the optimal code generation
generation
for expression with example.

29
Compute the basic blocks for the given
three address statements. Draw the
corresponding flow graph.
(1) PROD = 0 CO4 L4 basic
(2) I = 1 blocks
(3) T2 = addr(A) – 4
(4) T4 = addr(B) – 4
16
(5) T1 = 4 x I
(6) T3 = T2[T1]
(7) T5= T4[T1]
(8) T6 = T3 x T5
(9) PROD = PROD + T6
(10) I = I + 1
(11) IF I <=20 GOTO (5)
(12) IF J<=5 GOTO (7)
(13)I=I+J
30 16
Explain in detail about issues in the design code
L3
CO4 generator
of a code generator
31 Write down the Code Generation, Register 16
Code
descriptor and Address Descriptor for three CO4 Generatio
L3
n
address statement
F=(a+c)-(a+b)-(a+b)

UNIT TITLE
V CODE_OPTIMIZATION

SNO QUESTIONS RBT CO MARKS TOPIC IMAGES

L1 CO5 2 Optimiza
1 Define Optimization tion

L1 CO5 2 Optimizatio
2 Define Peephole Optimization n

L1 CO5 2 DAG
3 What is meant by DAG?

L1 CO5 2 Optimizati
4 Define common Expression Elimination
on

5 What is copy propagation? L2 CO5 2 Optimizatio


n
CO5 2 Optimizat
6 Define dead code Elimination L2
ion
L1 CO5 2 Optimizati
What is constant folding?
7 on
CO5 2 Code
8 Define Code motion L1
motion
9 What is Induction variable Elimation? L1 CO5 2 Optimiza
tion
10 Define strength reduction L1 CO5 2 Optimizati
on
11 What are techniques in peephole L1 CO5 2
peephole
optimization? optimizati
on?
12 L2 CO5 2
peephole
What is redundant instruction elimination?
optimizati
on?
13 L1 CO5 2
peephole
Define unreachable code elimination
optimizati
on?
14 What is meant by flow of control L1 CO5 2
peephole
optimizations? optimizati
on?
15 L1 CO5 2
peephole
Define algebraic simplification
optimizati
on?
16 L1 CO5 2
Define use of machine idioms peephole
optimizati
on?

171. Write down the DAG for following Three L2 CO5 2


DAG
address code
1. T1:=a+b
2. T2:=b+c
3. T3:=c+a

18 L2 CO5 2
What is meant by structure preserving structure
preserving
optimization? optimizati
on
19 L1 CO5 2
Define data flow equations data flow
equations
20 L2 CO5 2 algebraic
transf
What is meant by algebraic transformation?
ormati
on
21 CO5 12
global data
Explain global data flow analysis with flow
necessary equations analysis
L4
22 CO5 12
Discuss in detail about optimization of optimizati
on of basic
basic blocks blocks
L4
23 CO5 12
Explain in detail about peephole peephole
optimizati
optimization on
L4
24 CO5 12
Explain about the construction of DAG DAG
Algorithm
Algorithm
L4
25 CO5 12
Explain about the transformation of basic basic
blocks
blocks.
L4
26 What are the principal sources of CO5 L3
optimizati
optimization? Explain with suitable 16
on
examples.
27 Construct DAG for the following basic CO5 L4 16
DAG
block Algorithm
1. t1:= 4i;
2. t2:= a[t1]
3. t3:= 4*i
4. t4:= b[t3]
5. t5:= t2*t4
6. t6:= prod +t5
7. prod:= t6
8. t7:= i+1
9. i:=t7
10. if I <= 20
goto(1)
28 Construct the Directed Acyclic Graph for CO5 L4 16
DAG
the following statement Algorithm
a=b*c
d=b
e=d
b=e
f=b+c
g=f+d

29 Write down the following Optimization CO5 L3 16


Optimizati
Techniques with suitable examples on
Technique
i) Common Sub expression s
Elimination
ii) Constant Folding
iii) Copy Propagation
30 Write down the following Optimization CO5 L3 16
Optimizati
Techniques with suitable examples on
Technique
i) Dead code elimination s
ii) Code Motion
iii) Induction variable elimination
iv) Reduction in strength

You might also like