MCQ IN COMPUTER SCIENCE & ENGINEERING

COMPUTER SCIENCE AND ENGINEERING

COMPILER DESIGN

Question [CLICK ON ANY CHOICE TO KNOW THE RIGHT ANSWER]
Structure preserving transformations on basic blocks are
A
Common sub-expression elimination
B
Dead-code elimination
C
Renaming of temporary variables
D
All the above
Explanation: 

Detailed explanation-1: -The primary Structure-Preserving Transformation on basic blocks is as follows: Common sub-expression elimination. Dead code elimination. Renaming of temporary variables.

Detailed explanation-2: -The structure-preserving transformation on basic blocks includes: Dead Code Elimination. Common Subexpression Elimination. Renaming of Temporary variables.

Detailed explanation-3: -2.1 Function-Preserving Transformations o Constant folding, are common examples of such function-preserving transformations. The other transformations come up primarily when global optimizations are performed. Frequently, a program will include several calculations of the same value, such as an offset in an array.

Detailed explanation-4: -The primary Structure-Preserving Transformation on basic blocks are as follows: Common sub-expression elimination. Dead code elimination. Renaming of temporary variables.

Detailed explanation-5: -Basic Block is a straight line code sequence that has no branches in and out branches except to the entry and at the end respectively. Basic Block is a set of statements that always executes one after other, in a sequence.

There is 1 question to complete.