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

Discussion

Spilling a value during register allocation means

  • A.storing it in memory and reloading it when it is next needed
  • B.discarding it because it will never be used again
  • C.recomputing it on each occasion rather than storing it at all
  • D.moving it to a register belonging to another procedure

Answer: A

Spilling costs a store and one or more loads, so allocators try to spill the value used least often. Rematerialisation, recomputing a cheap value instead, is sometimes preferred. A constant is almost always cheaper to recompute than to reload.

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

Post your comment

Please log in or register to post a comment.