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

Discussion

Dead code elimination is usually run more than once during compilation because

  • A.the pass must be repeated once for every basic block present
  • B.earlier transformations keep making further code dead
  • C.the pass is unable to remove all the dead code in one go
  • D.each run removes only the first dead statement it encounters

Answer: B

Constant propagation may make a branch unreachable and copy propagation may leave an assignment with no remaining uses. Each round of removal can therefore expose more dead code, so the pass is iterated until nothing further changes.

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

Post your comment

Please log in or register to post a comment.