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

Discussion

A flow graph is constructed from basic blocks by

  • A.merging all the blocks that contain no jump instructions
  • B.adding an edge wherever control can pass from one block to another
  • C.connecting every block to every other block in the program
  • D.ordering the blocks by the number of instructions each contains

Answer: B

Correct answer: adding an edge wherever control can pass from one block to another

The nodes are the basic blocks and the edges are the possible transfers between them - a jump, a conditional branch taken or not taken, or simply falling through. That graph is what every data flow analysis propagates its facts over, so building it correctly is a precondition for optimising at all.

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

Post your comment

Please log in or register to post a comment.