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

Discussion

A basic block is

  • A.a procedure together with all the procedures it calls
  • B.the set of all instructions that reference a given variable
  • C.a maximal sequence of instructions entered only at its first
  • D.the body of any loop appearing in the source program

Answer: C

Correct answer: a maximal sequence of instructions entered only at its first

A basic block is a straight-line sequence with one entry, at the top, and one exit, at the bottom - no branch enters part-way and none leaves except at the end.

That property is what makes it the unit of local optimisation: within a block, execution is guaranteed to run from first instruction to last, so the compiler can reason about the sequence without considering alternative paths. "Maximal" matters, the block being extended until a branch or a label forces a boundary.

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

Post your comment

Please log in or register to post a comment.