Open main menu
Home
Random
Recent changes
Special pages
Community portal
Preferences
About Wikipedia
Disclaimers
Incubator escapee wiki
Search
User menu
Talk
Dark mode
Contributions
Create account
Log in
Editing
Register allocation
(section)
Warning:
You are not logged in. Your IP address will be publicly visible if you make any edits. If you
log in
or
create an account
, your edits will be attributed to your username, along with other benefits.
Anti-spam check. Do
not
fill this in!
==== Pseudocode ==== This describes the algorithm as first proposed by Poletto et al.,{{sfn|Poletto|Sarkar|1999|p=899}} where: * '''R''' is the number of available registers. * '''active''' is the list, sorted in order of increasing end point, of live intervals overlapping the current point and placed in registers. '''LinearScanRegisterAllocation''' active β {} '''for each''' live interval ''i'', in order of increasing start point '''do''' ExpireOldIntervals(i) '''if''' length(active) = R '''then''' SpillAtInterval(i) '''else''' register[i] β a register removed from pool of free registers add ''i'' to active, sorted by increasing end point '''ExpireOldIntervals(i)''' '''for each''' interval ''j'' '''in''' active, in order of increasing end point '''do''' '''if''' endpoint[j] β₯ startpoint[i] '''then''' '''return''' remove ''j'' from active add register[j] to pool of free registers '''SpillAtInterval(i)''' spill β last interval in active '''if''' endpoint[spill] > endpoint[i] '''then''' register[i] β register[spill] location[spill] β new stack location remove spill from active add ''i'' to active, sorted by increasing end point '''else''' location[i] β new stack location
Edit summary
(Briefly describe your changes)
By publishing changes, you agree to the
Terms of Use
, and you irrevocably agree to release your contribution under the
CC BY-SA 4.0 License
and the
GFDL
. You agree that a hyperlink or URL is sufficient attribution under the Creative Commons license.
Cancel
Editing help
(opens in new window)