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

Discussion

An interference graph requires 5 colours but the machine has only 4 registers. What must the allocator do?

  • A.spill at least one value to memory
  • B.reject the program as impossible to compile
  • C.allocate a fifth register that the machine lacks
  • D.recolour the graph using only three colours

Answer: A

Spilling removes a node from the graph, which may make the rest colourable. The spilled value is stored and reloaded around its uses, which costs memory traffic but always succeeds. Spilling therefore guarantees that allocation eventually terminates.

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

Post your comment

Please log in or register to post a comment.