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

Discussion

Partial redundancy elimination generalises common subexpression elimination by

  • A.computing expressions before the program starts running
  • B.restricting attention to a single basic block at a time
  • C.removing a computation redundant on some but not all paths
  • D.removing a computation redundant on absolutely every path

Answer: C

Correct answer: removing a computation redundant on some but not all paths

Common subexpression elimination requires the expression to be available on every path, which fails if one branch computes it and another does not. Partial redundancy elimination inserts the computation on the paths lacking it, making it fully redundant at the join, and then removes it - and it subsumes loop invariant code motion as a special case.

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

Post your comment

Please log in or register to post a comment.