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

Discussion

Optimising for size and optimising for speed conflict most obviously in

  • A.dead code elimination and unreachable code removal
  • B.sharing a repeated computation within one stretch of straight line code
  • C.loop unrolling and function inlining
  • D.constant folding and constant propagation

Answer: C

Correct answer: loop unrolling and function inlining

Both trade code size for speed directly: unrolling duplicates the body to amortise the loop control, and inlining duplicates the callee at every site. Under an optimise-for-size setting both are curtailed. Dead code removal, common subexpression elimination and constant folding all reduce size and time together, so they present no conflict.

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

Post your comment

Please log in or register to post a comment.