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

Discussion

Optimal code generation in the general case is

  • A.achieved routinely by every production compiler
  • B.impossible because the machine is not known at compile time
  • C.unnecessary because all instruction sequences cost the same
  • D.intractable, so heuristics are used throughout the back end

Answer: D

Correct answer: intractable, so heuristics are used throughout the back end

Instruction selection over a graph, register allocation by colouring, and instruction scheduling are each NP-hard on their own, and they interact so that solving one well can worsen another. Every production compiler therefore uses heuristics, and the quality of its code is the quality of those heuristics.

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

Post your comment

Please log in or register to post a comment.