39 39 votes Which one of the following is FALSE? A basic block is a sequence of instructions where control enters the sequence at the beginning and exits at the end. Available expression analysis can be used for common subexpression elimination. Live variable analysis can be used for dead code elimination. $x=4*5 \Rightarrow x=20$ is an example of common subexpression elimination. Compiler Design gatecse-2014-set1 compiler-design code-optimization normal + – go_editor 17.5k views answer comment Share Follow Print See all 8 Comments 8 8 Comments reply Show 5 previous comments ritiksri8 commented Dec 7, 2024 reply Follow flag Liveness analysis checks if a variable is still needed in the future, while available analysis checks if a result is already ready to use. 3 3 replyShare Umesh Shelke commented Oct 29, 2025 reply Follow flag Constant Folding : whenever we have constants we can fold them to save time and space at runtime.Example:- $\text{x = }\textcolor{red}{2 * 3}\text{ + y; ⇛ x = }\textcolor{red}{6}\text{ + y; [ replace }\textcolor{red}{2 * 3}\text{ with }\textcolor{red}{6}\text{ ]}$Constant Propagation: process of replacing the constant value of variables in the expression.Example:- $\text{ x = }\textcolor{red}{2}\text{; y = }\textcolor{red}{x}\text{ * a; ⇛ y = }\textcolor{red}{2}\text{ * a; [ replace }\textcolor{red}{x}\text{ with }\textcolor{red}{2}\text{ ]}$ 1 1 replyShare S_Sandeep commented Jul 8 reply Follow flag is constant propagation in syllabus? 0 0 replyShare Please log in or register to add a comment.
Best answer 52 52 votes A basic block is a sequence of instructions where control enters the sequence at the beginning and exits at the end, which is TRUE. Available expression analysis can be used for common subexpression elimination is TRUE. Available expressions is an analysis algorithm that determines for each point in the program the set of expressions that need not be recomputed. Available expression analysis is used to do global common subexpression elimination (CSE). If an expression is available at a point, there is no need to re-evaluate it. Live variable analysis can be used for dead code elimination is TRUE. $x = 4 ∗ 5 \Rightarrow x = 20$ is an example of common subexpression elimination is FALSE. Common subexpression elimination (CSE) refers to compiler optimization replaces identical expressions (i.e., they all evaluate to the same value) with a single variable holding the computed value when it is worthwhile to do so Source: GeeksforgeeksCorrect Answer: $D$ richa116 answered Dec 12, 2015 • edited Dec 19, 2024 by Hira Thakur richa116 comment Share Follow See all 9 Comments 9 9 Comments reply Show 6 previous comments Thadymademe commented Oct 18, 2022 reply Follow flag @madhes23 “Liveliness Analysis consists of a specified technique that is implemented to optimize register space allocation, for a given piece of code and facilitate the procedure for dead-code elimination.” Source:- Liveliness Analysis in Compiler Design - GeeksforGeeks 3 3 replyShare Abhrajyoti00 commented Dec 25, 2022 reply Follow flag Adding info to @Shashwat21225 ‘s comment:- Constant folding vs. Constant propagation The difference is that constant propagation is not saving a variable to the stack, because we know its a constant (like x = 10;) and can simply plug it in everywhere (say if you had an expression y = x + x + x => y = 10 + 10 + 10) it is used in machine code. Whereas, constant folding is simply evaluating expressions that use constants and substituting the result into the machine code (like y = 10 + 10 + 10; => y = 30;) 7 7 replyShare js__ commented Nov 1, 2025 reply Follow flag Constant folding can be seen as a prerequisite or a component of constant propagation.Constant propagation can use the results of constant folding to perform its substitution. 0 0 replyShare Please log in or register to add a comment.
0 0 votes Right option is D Surya013 answered Jul 15, 2025 Surya013 comment Share Follow 0 reply Please log in or register to add a comment.