Question 56
If 'x = 5' is assigned, and subsequent statement 'y = x + 2' is replaced by 'y = 5 + 2' at compile time, this optimization is:
Constant Propagation replaces variable references with known constant values assigned earlier in the code.
If 'x = 5' is assigned, and subsequent statement 'y = x + 2' is replaced by 'y = 5 + 2' at compile time, this optimization is:
Constant Propagation replaces variable references with known constant values assigned earlier in the code.
What is 'Loop-Invariant Code Motion' (Code Motion)?
Code Motion detects statements inside a loop whose operands remain constant across all iterations and moves them to the loop pre-header.
What is 'Dead Code Elimination'?
Dead code elimination identifies and removes instructions that compute values that are never subsequently read or used anywhere in the program.
In Data-Flow Analysis, an expression 'x + y' is said to be 'Available' at point p if:
Available Expression Analysis is a MUST-analysis: an expression is available at p if along EVERY path from entry to p, the expression has been evaluated and its operands were not modified afterwards.
A variable 'x' is defined as 'Live' at point p if:
Live Variable Analysis is a MAY-analysis (backward): x is live at p if there exists SOME execution path from p to a future use of x where x is read before being overwritten.