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

Discussion

The number of colours available when register allocation is modelled as graph colouring corresponds to

  • A.the number of basic blocks in the procedure's flow graph
  • B.the number of distinct types declared in the source program
  • C.the number of registers the target machine provides
  • D.the number of values that the procedure computes

Answer: C

Each colour stands for one physical register, so a graph needing more colours than the machine has registers cannot be coloured as it stands. Removing a node by spilling its value to memory is what makes the remaining graph colourable.

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

Post your comment

Please log in or register to post a comment.