Computer Science EngineeringHard
Moving a computation whose value does not change inside a loop to before the loop is called
- A. loop-invariant code motion
- B. constant folding
- C. peephole optimization
- D. function inlining
Correct answer: A. loop-invariant code motion
Hoisting invariant expressions avoids recomputing them in every iteration.
Practise more Theory of Computation, Compilers & Digital Logic (ISRO CS) questionsTheory of Computation, Compilers & Digital Logic (ISRO CS): notes and key points
More Theory of Computation, Compilers & Digital Logic (ISRO CS) questions
- A language accepted by some Turing machine (which may loop on strings outside the language) is called
- Which problem was the first to be proved NP-complete (Cook-Levin theorem)?
- The minimal complete DFA over {a, b} for the language ab has how many states?
- The grammar S -> aSa | bSb | a | b | epsilon generates
- An int a[10][20] array is stored in row-major order with base address 1000 and 4-byte elements. The address of a[3][5] is
- Which machine model is equivalent in power to context-free grammars?