GetReg
28/43
GetReg
:
begin
if
b
is in register R
and
b
is dead
and
b
has no next use
then
return R
else
if
there is any free register R
then
return R
else begin
•
select an occupied register R
•
save R’s current contents
•
update RAT
&
AT
•
return R
end;
end;
•
GetReg
returns an optimal register
for
b
in
a :=
b
+ c