In compiler design, which optimization technique moves computations outside loops?
-
A
Constant folding
-
B
Loop invariant code motion
Correct answer
-
C
Common subexpression elimination
-
D
Dead code elimination
Correct answer
B. Loop invariant code motion
13 views
Explanation
Loop invariant code motion identifies and moves computations that don't change within loops.
Doubts & discussion
Not sure why the answer is B? Ask here and get an explanation.
Ask a doubt about this MCQ