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

Discussion

Profile guided optimisation uses

  • A.the number of instructions in each basic block
  • B.measurements from earlier runs to guide the transformations
  • C.the comments in the source to decide which code matters most
  • D.a static estimate of how often each branch is taken

Answer: B

Correct answer: measurements from earlier runs to guide the transformations

A static heuristic can only guess which branch is taken and which loop runs hot. A profile from a representative run supplies the actual frequencies, so inlining, block layout and register allocation can all be directed at the code that matters. The weakness is that the profile must resemble real use, or the optimisation is aimed at the wrong code.

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

Post your comment

Please log in or register to post a comment.