mirror of
https://gitlab.com/freepascal.org/fpc/source.git
synced 2025-04-16 00:42:06 +02:00
* Some work on interference graph construction
This commit is contained in:
parent
56132c1a9c
commit
a32926e2fc
@ -284,7 +284,9 @@ implementation
|
||||
begin
|
||||
result:=nil;
|
||||
{ no temps over several statements }
|
||||
{$ifndef newra}
|
||||
rg.cleartempgen;
|
||||
{$endif}
|
||||
{ left is the statement itself calln assignn or a complex one }
|
||||
firstpass(left);
|
||||
if codegenerror then
|
||||
@ -419,7 +421,9 @@ implementation
|
||||
end;
|
||||
if assigned(hp.left) then
|
||||
begin
|
||||
{$ifndef newra}
|
||||
rg.cleartempgen;
|
||||
{$endif}
|
||||
codegenerror:=false;
|
||||
firstpass(hp.left);
|
||||
|
||||
@ -764,7 +768,10 @@ begin
|
||||
end.
|
||||
{
|
||||
$Log$
|
||||
Revision 1.41 2003-04-12 14:53:59 jonas
|
||||
Revision 1.42 2003-04-17 07:50:24 daniel
|
||||
* Some work on interference graph construction
|
||||
|
||||
Revision 1.41 2003/04/12 14:53:59 jonas
|
||||
* ttempdeletenode.create now sets the nodetype to tempdeleten instead of
|
||||
temprefn
|
||||
|
||||
|
@ -92,7 +92,9 @@ interface
|
||||
begin
|
||||
if assigned(tstatementnode(hp).left) then
|
||||
begin
|
||||
{$ifndef newra}
|
||||
rg.cleartempgen;
|
||||
{$endif newra}
|
||||
secondpass(tstatementnode(hp).left);
|
||||
{ Compiler inserted blocks can return values }
|
||||
location_copy(location,tstatementnode(hp).left.location);
|
||||
@ -288,7 +290,10 @@ begin
|
||||
end.
|
||||
{
|
||||
$Log$
|
||||
Revision 1.29 2003-03-28 19:16:56 peter
|
||||
Revision 1.30 2003-04-17 07:50:24 daniel
|
||||
* Some work on interference graph construction
|
||||
|
||||
Revision 1.29 2003/03/28 19:16:56 peter
|
||||
* generic constructor working for i386
|
||||
* remove fixed self register
|
||||
* esi added as address register for i386
|
||||
|
@ -136,7 +136,9 @@ implementation
|
||||
|
||||
aktcontinuelabel:=lcont;
|
||||
aktbreaklabel:=lbreak;
|
||||
{$ifndef newra}
|
||||
rg.cleartempgen;
|
||||
{$endif}
|
||||
if assigned(right) then
|
||||
secondpass(right);
|
||||
|
||||
@ -155,7 +157,9 @@ implementation
|
||||
truelabel:=lloop;
|
||||
falselabel:=lbreak;
|
||||
end;
|
||||
{$ifndef newra}
|
||||
rg.cleartempgen;
|
||||
{$endif}
|
||||
secondpass(left);
|
||||
|
||||
maketojumpbool(exprasmlist,left,lr_load_regvars);
|
||||
@ -190,7 +194,9 @@ implementation
|
||||
oflabel:=falselabel;
|
||||
objectlibrary.getlabel(truelabel);
|
||||
objectlibrary.getlabel(falselabel);
|
||||
{$ifndef newra}
|
||||
rg.cleartempgen;
|
||||
{$endif}
|
||||
secondpass(left);
|
||||
|
||||
|
||||
@ -209,7 +215,9 @@ implementation
|
||||
if assigned(right) then
|
||||
begin
|
||||
cg.a_label(exprasmlist,truelabel);
|
||||
{$ifndef newra}
|
||||
rg.cleartempgen;
|
||||
{$endif}
|
||||
secondpass(right);
|
||||
end;
|
||||
|
||||
@ -236,7 +244,9 @@ implementation
|
||||
cg.a_jmp_always(exprasmlist,hl);
|
||||
end;
|
||||
cg.a_label(exprasmlist,falselabel);
|
||||
{$ifndef newra}
|
||||
rg.cleartempgen;
|
||||
{$endif}
|
||||
secondpass(t1);
|
||||
{ save current asmlist (previous instructions + else-block) }
|
||||
{ and loaded regvar state and create a new clean list }
|
||||
@ -319,15 +329,19 @@ implementation
|
||||
objectlibrary.getlabel(l3);
|
||||
|
||||
{ only calculate reference }
|
||||
{$ifndef newra}
|
||||
rg.cleartempgen;
|
||||
{$endif}
|
||||
secondpass(t2);
|
||||
hs := t2.resulttype.def.size;
|
||||
opsize := def_cgsize(t2.resulttype.def);
|
||||
|
||||
{ first set the to value
|
||||
because the count var can be in the expression !! }
|
||||
{$ifndef newra}
|
||||
rg.cleartempgen;
|
||||
|
||||
{$endif}
|
||||
|
||||
do_loopvar_at_end:=lnf_dont_mind_loopvar_on_exit in loopflags;
|
||||
|
||||
secondpass(right);
|
||||
@ -353,7 +367,9 @@ implementation
|
||||
temptovalue:=false;
|
||||
|
||||
{ produce start assignment }
|
||||
{$ifndef newra}
|
||||
rg.cleartempgen;
|
||||
{$endif}
|
||||
secondpass(left);
|
||||
count_var_is_signed:=is_signed(t2.resulttype.def);
|
||||
|
||||
@ -415,7 +431,9 @@ implementation
|
||||
end;
|
||||
|
||||
{ help register must not be in instruction block }
|
||||
{$ifndef newra}
|
||||
rg.cleartempgen;
|
||||
{$endif}
|
||||
if assigned(t1) then
|
||||
begin
|
||||
secondpass(t1);
|
||||
@ -437,7 +455,9 @@ implementation
|
||||
cg.a_label(exprasmlist,aktcontinuelabel);
|
||||
|
||||
{ makes no problems there }
|
||||
{$ifndef newra}
|
||||
rg.cleartempgen;
|
||||
{$endif}
|
||||
|
||||
if do_loopvar_at_end then
|
||||
if lnf_backward in loopflags then
|
||||
@ -857,7 +877,9 @@ implementation
|
||||
begin
|
||||
load_all_regvars(exprasmlist);
|
||||
cg.a_label(exprasmlist,labelnr);
|
||||
{$ifndef newra}
|
||||
rg.cleartempgen;
|
||||
{$endif newra}
|
||||
secondpass(left);
|
||||
end;
|
||||
|
||||
@ -1322,7 +1344,9 @@ implementation
|
||||
{ next on node }
|
||||
if assigned(left) then
|
||||
begin
|
||||
{$ifndef newra}
|
||||
rg.cleartempgen;
|
||||
{$endif newra}
|
||||
secondpass(left);
|
||||
end;
|
||||
end;
|
||||
@ -1483,7 +1507,10 @@ begin
|
||||
end.
|
||||
{
|
||||
$Log$
|
||||
Revision 1.53 2003-04-06 21:11:23 olle
|
||||
Revision 1.54 2003-04-17 07:50:24 daniel
|
||||
* Some work on interference graph construction
|
||||
|
||||
Revision 1.53 2003/04/06 21:11:23 olle
|
||||
* changed newasmsymbol to newasmsymboldata for data symbols
|
||||
|
||||
Revision 1.52 2003/03/28 19:16:56 peter
|
||||
|
@ -372,6 +372,9 @@ implementation
|
||||
aktprocdef.usedotherregisters:=rg.usedinproc;
|
||||
procinfo.aktproccode.insertlist(procinfo.aktentrycode);
|
||||
procinfo.aktproccode.concatlist(procinfo.aktexitcode);
|
||||
{$ifdef newra}
|
||||
rg.writegraph;
|
||||
{$endif}
|
||||
if not(cs_no_regalloc in aktglobalswitches) then
|
||||
begin
|
||||
procinfo.aktproccode.convert_registers;
|
||||
@ -864,7 +867,10 @@ implementation
|
||||
end.
|
||||
{
|
||||
$Log$
|
||||
Revision 1.97 2003-04-16 09:26:55 jonas
|
||||
Revision 1.98 2003-04-17 07:50:24 daniel
|
||||
* Some work on interference graph construction
|
||||
|
||||
Revision 1.97 2003/04/16 09:26:55 jonas
|
||||
* assembler procedures now again get a stackframe if they have local
|
||||
variables. No space is reserved for a function result however.
|
||||
Also, the register parameters aren't automatically saved on the stack
|
||||
|
@ -285,6 +285,9 @@ unit rgobj;
|
||||
|
||||
procedure saveUnusedState(var state: pointer);virtual;
|
||||
procedure restoreUnusedState(var state: pointer);virtual;
|
||||
{$ifdef newra}
|
||||
procedure writegraph;
|
||||
{$endif}
|
||||
protected
|
||||
{$ifdef newra}
|
||||
igraph:Tinterferencegraph;
|
||||
@ -535,6 +538,9 @@ unit rgobj;
|
||||
inc(countunusedregs);
|
||||
include(unusedregs,supreg);
|
||||
list.concat(tai_regalloc.dealloc(r));
|
||||
{$ifdef newra}
|
||||
add_edges_used(supreg);
|
||||
{$endif newra}
|
||||
end;
|
||||
|
||||
|
||||
@ -1211,6 +1217,38 @@ unit rgobj;
|
||||
if not(i in unusedregsint) then
|
||||
add_edge(u,i);
|
||||
end;
|
||||
|
||||
procedure Trgobj.writegraph;
|
||||
|
||||
var f:text;
|
||||
i,j:Tsuperregister;
|
||||
|
||||
begin
|
||||
assign(f,'igraph');
|
||||
rewrite(f);
|
||||
writeln(f,'Interference graph');
|
||||
writeln(f);
|
||||
write(f,' ');
|
||||
for i:=0 to 15 do
|
||||
for j:=0 to 15 do
|
||||
write(f,hexstr(i,1));
|
||||
writeln(f);
|
||||
write(f,' ');
|
||||
for i:=0 to 15 do
|
||||
write(f,'0123456789ABCDEF');
|
||||
writeln(f);
|
||||
for i:=0 to 255 do
|
||||
begin
|
||||
write(f,hexstr(i,2):4);
|
||||
for j:=0 to 255 do
|
||||
if j in igraph.bitmap[i] then
|
||||
write(f,'*')
|
||||
else
|
||||
write(f,'-');
|
||||
writeln(f);
|
||||
end;
|
||||
close(f);
|
||||
end;
|
||||
{$endif}
|
||||
|
||||
|
||||
@ -1343,7 +1381,10 @@ end.
|
||||
|
||||
{
|
||||
$Log$
|
||||
Revision 1.32 2003-03-28 19:16:57 peter
|
||||
Revision 1.33 2003-04-17 07:50:24 daniel
|
||||
* Some work on interference graph construction
|
||||
|
||||
Revision 1.32 2003/03/28 19:16:57 peter
|
||||
* generic constructor working for i386
|
||||
* remove fixed self register
|
||||
* esi added as address register for i386
|
||||
|
Loading…
Reference in New Issue
Block a user