Posted on January 6, 2018 and last updated on February 28, 2023 by Mistral Contrastin

Compiler Construction Example Sheet IV

  1. This question is about function inlining. It is a common optimisation and most C implementations have directives for it. How can it adversely affect computation time? What sort of functions would be ideal candidates for inlining? (Hint: remember computer design lectures)

  2. What is the scope of peephole optimisations? What are the other class of optimisations and rank them in difficulty with brief justification to your ranking. Give five examples of peephole optimisations.

  3. From Mogensen (2009, chap. 13), solve Exercise 13.2.

  4. 2017/3/3

  5. 2021/4/3 only part (a)

  6. 2019/4/4

  7. 2018/4/3 only part (g)

Mogensen, T.Æ., 2009. Basics of compiler design. Torben Ægidius Mogensen.