1.

The identification of common sub-expression and replacement of run-time computations by compile-time computations is _____________(a) Local optimization(b) Loop optimization(c) Constant folding(d) Data flow analysisThis question was addressed to me during an online exam.Asked question is from Implementation of the Translation Specified by Syntax-Directed Definitions topic in portion Syntax Directed Definition and Translations of Compiler

Answer»

The correct choice is (c) CONSTANT folding

For EXPLANATION: Constant folding is the process of recognizing and evaluating constant expressions at compile time rather than computing them at runtime. Terms in constant expressions are typically simple LITERALS they may also be variables WHOSE values are assigned at compile time.



Discussion

No Comment Found

Related InterviewSolutions