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

Discussion

Code hoisting, as distinct from loop invariant motion, moves a computation

  • A.into a separate procedure called from each use
  • B.to a point that dominates all the places where it is needed
  • C.into the innermost loop, where it happens to be used most often
  • D.to the end of the procedure after all uses of it

Answer: B

Hoisting to a common dominator reduces code size by keeping one copy where several existed. It is chiefly a size optimisation rather than a speed one. The dominator relation is what identifies the safe place to put the single copy.

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

Post your comment

Please log in or register to post a comment.