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

Discussion

A redundant load elimination in a peephole optimiser removes

  • A.every load instruction in the generated program
  • B.a store whose value happens to be used later on in the program
  • C.an instruction that computes an address
  • D.a load of a value that was just stored from the same register

Answer: D

The value is already in the register, so the load achieves nothing. Care is needed when a label sits between the two, since control may then arrive without the store having executed. Confining the window to a single basic block avoids the problem entirely.

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

Post your comment

Please log in or register to post a comment.