Recent questions tagged code-optimization

7 7 votes
7 7 answers
2.2k
2.2k views
Consider the control flow graph shown in the figure. Which one of the following options correctly lists the set of redundant expressions (common subexpressions) in the ba...
1 1 vote
1 answers 1 answer
227
227 views
Match the following statements with True (T) / False (F).S1: replacing A + 4*3 with A + 12 is called strength reductionS2: replacing A * 4 with A << 2 is called constant ...
1 1 vote
2 2 answers
346
346 views
Which one of the following is FALSE?Reaching Definitions analysis is a forward data flow analysis problem. Live Variable analysis is used to determine which variables hol...
0 0 votes
1 1 answer
305
305 views
Consider the following Three Address code sample for solving the questions:$\begin{array}{lll} 100 & : & t1=y+2 \\ 101 & : & \mathrm{initial } = x/t1 \\ 102 & : & \math...
0 0 votes
0 0 answers
226
226 views
Regarding the code optimization, choose the correct sequenceAlgebraic SimplificationUse of machine idiomsRedundant - instruction eliminationFlow of control optimizationIm...
0 0 votes
2 2 answers
431
431 views
Arrange the following stages of parsing in the correct order as they typically occur in the compilation process.Lexical AnalysisSematic AnalysisSyntax AnalysisIntermediat...
0 0 votes
1 1 answer
188
188 views
Which of the following best describes the purpose of the "backpatching" technique in code generation?It is used to resolve forward jumps by filling in missing addresses.I...
22 22 votes
5 5 answers
6.9k
6.9k views
Which ONE of the following techniques used in compiler code optimization uses live variable analysis?Run-time function call managementRegister assignment to variablesStre...
0 0 votes
2 2 answers
782
782 views
6. Generate code for the following C program using any code generation algorithm. [3 Marks] main() { int x, a, b, c, d, e; ...
0 0 votes
0 0 answers
368
368 views
Find the FIRST and FOLLOW of the grammar to check whether it is LL (1) parser or not. N → AB | BA A → a | CAC B → b | CBC C → a | b
0 0 votes
0 0 answers
428
428 views
Please provide in detail solution step by step 5. Find the FIRST and FOLLOW of the grammar to check whether it is LL (1) parser or not. N → AB | BA A → a | CAC ...
0 0 votes
0 0 answers
530
530 views
Dead-code elimination in machine code optimization refers to :removal of all labels.removal of values that never get used.removal of function which are not involved.remov...
0 0 votes
2 2 answers
1.5k
1.5k views
Please Answer this question in detail step by step: 3. Translate the arithmetic expression (a + b * c) + d + (a + b * c) − d + e into: a). Syntax tree, (please draw...
0 0 votes
1 1 answer
868
868 views
$\text{ Anyone please explain : }$
0 0 votes
1 1 answer
590
590 views
Please explain how 2?
1 1 vote
0 0 answers
929
929 views
Consider the expression $(a-1) * (((b+c) / 3)) + d))$. Let $\text{X}$ be the minimum number of registers required by an optimal code generation (without any register spil...
2 2 votes
0 0 answers
1.0k
1.0k views
Consider these two functions and two statements $\text{S1}$ and $\text{S2}$ about them. int work1(int *a, int i, int j) { int x = a[i+2]; a[j] = x+1; return a[i+2] - 3; }...
1 1 vote
1 answers 1 answer
2.7k
2.7k views
A variable v is live at a program point p if some path from p to program exit contains an r-value occurrence of v which is not preceded by an l-value occurrence of v . Th...
0 0 votes
1 1 answer
633
633 views
How to approach such questions ?
42 42 votes
3 answers 3 answers
20.5k
20.5k views
​​​​​​Consider the following $\text{ANSI C}$ code segment:z=x + 3 + y->f1 + y->f2; for (i = 0; i < 200; i = i + 2) { if (z i) { p = p + x + 3; q = q + y->f1; } else { p ...