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

Discussion

Constant propagation is the transformation that

  • A.evaluates an expression whose operands are all literal constants
  • B.eliminates a variable that is assigned but never read
  • C.reorders instructions so constants are computed first
  • D.replaces a use of a variable by the constant it must hold there

Answer: D

Establishing that only one constant reaches the use is a data flow question. Propagation and folding reinforce one another, each creating opportunities for the other. Running the pair repeatedly until nothing changes is common practice.

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

Post your comment

Please log in or register to post a comment.