Machine-translated by Google. Questions are authored in English.
Top

Discussion

The following are all machine independent optimisations EXCEPT

  • A.instruction selection to exploit an addressing mode of the target
  • B.common subexpression elimination across a basic block
  • C.constant folding of expressions known at compile time
  • D.dead code elimination of the statements that can never be reached at all

Answer: A

Correct answer: instruction selection to exploit an addressing mode of the target

An optimisation is machine independent if it can be applied to the intermediate code without knowing the target. Instruction selection is the opposite: it exists precisely to exploit a particular machine's instruction set and addressing modes.

The other three qualify. Common subexpression elimination, constant folding and dead code elimination all work on the structure of the computation itself and would improve the program on any target. The distinction is what makes a common intermediate representation worth having.

No comment is present. Be the first to comment.
Loading…

Post your comment

Please log in or register to post a comment.