DA-1(C).pdf

School
Vellore Institute of Technology*
*We are not endorsed by this school
Course
CSE BSTS302P
Pages
2
Upload Date
Feb 10, 2024
Uploaded by ElderSquirrel4069 on coursehero.com

DA-1(C).pdf

School
Vellore Institute of Technology*
*We are not endorsed by this school
Course
CSE BSTS302P
Pages
2
Upload Date
Feb 10, 2024
Uploaded by ElderSquirrel4069 on coursehero.com
SCHOOL OF COMPUTER SCIENCE AND ENGINEERING Digital Assignment - 1(C), Fall Inter Semester - 2022-23 Course Code : BCSE307L Programme: B. Tech Course Name : Compiler Design Max. Marks: 10 Slot : F 1 /F2 Faculty: Dr. WI. Sureshkumar Answer all the Questions 1) Consider the following basic block, in which all variables are integers and ** denotes exponentiation a := x ** 2 b := 3 c := x d := c * c e := b * 2 f := a + d g := e * f Apply the following optimization techniques to this basic block, in order. Compute the result of each transformation i. Algebraic simplification ii. Copy propagation iii. Constant folding iv. Dead code elimination v. Common sub-expression elimination 2) Why code optimization is necessary in compiler design. For the following code segment, obtain the basic blocks and draw a control flow graph. w = 0; x = x + y; y = 0;
if (x > z ) { y = x; x++ ; } else { y = z ; z++ ; } w = x + z; From the flow graph, find dominators, dominator tree and natural loops. 3) Explain how parallel machines differs with respect to instruction streams and architecture. Illustrate with relevant examples. 4) Analyse the difference between scalar processor and vector processor with respect to compiler design aspects. Illustrate with relevant examples. Note: 1 Solve the problems in hand, scan the document and upload it. 2 Typed material will not be considered 3 Kindly stick on deadline Submit on or before: 20-July-2023 ----------------XXXXXXXXX--------------------
Page1of 2
Uploaded by ElderSquirrel4069 on coursehero.com