in Compiler Design retagged by
4,118 views
4 votes
4 votes

The identification of common sub-expression and replacement of run time computations by compile-time computations is:

  1. Local optimization
  2. Constant folding
  3. Loop Optimization
  4. Data flow analysis
in Compiler Design retagged by
by
4.1k views

3 Answers

1 vote
1 vote
Option B is correct.

Constant Folding....Actually...whenever subexpression is repeated many times....so we can fold that part into a single segment to reduce the space and time complexity of the program.
1 vote
1 vote
answer:- (b)

constant folding is an optimization from that has no side effects and that can be evaluated repeatedly to produce value= 1.

2 Comments

How 1?

How is common subexpression relevant to constant folding?
0
0
by common sub expression we mean- the expression which is already computed but during compilation it again appears for computation.

in constant folding - the expression which is having a constant value at the time of compilation it can be referred to its respective value or we can say that it can be replaced with its similar value.

like we can use 3.14 for 22/7 in the circumference of a circle.

this is what has been asked in question - that The identification of common sub-expression and replacement of run time computations by compile-time computations is known as what??

its constant folding where the replacement is done during compilation time.
1
1
1 vote
1 vote

option B

Constant folding : replacing the value of constants during compilation
Constant propagation : replacing the value of an expression during compile time.

Answer:

Related questions