* Some work on interference graph construction

This commit is contained in:
daniel 2003-04-17 07:50:24 +00:00
parent 56132c1a9c
commit a32926e2fc
5 changed files with 92 additions and 6 deletions

View File

@ -284,7 +284,9 @@ implementation
begin begin
result:=nil; result:=nil;
{ no temps over several statements } { no temps over several statements }
{$ifndef newra}
rg.cleartempgen; rg.cleartempgen;
{$endif}
{ left is the statement itself calln assignn or a complex one } { left is the statement itself calln assignn or a complex one }
firstpass(left); firstpass(left);
if codegenerror then if codegenerror then
@ -419,7 +421,9 @@ implementation
end; end;
if assigned(hp.left) then if assigned(hp.left) then
begin begin
{$ifndef newra}
rg.cleartempgen; rg.cleartempgen;
{$endif}
codegenerror:=false; codegenerror:=false;
firstpass(hp.left); firstpass(hp.left);
@ -764,7 +768,10 @@ begin
end. end.
{ {
$Log$ $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 * ttempdeletenode.create now sets the nodetype to tempdeleten instead of
temprefn temprefn

View File

@ -92,7 +92,9 @@ interface
begin begin
if assigned(tstatementnode(hp).left) then if assigned(tstatementnode(hp).left) then
begin begin
{$ifndef newra}
rg.cleartempgen; rg.cleartempgen;
{$endif newra}
secondpass(tstatementnode(hp).left); secondpass(tstatementnode(hp).left);
{ Compiler inserted blocks can return values } { Compiler inserted blocks can return values }
location_copy(location,tstatementnode(hp).left.location); location_copy(location,tstatementnode(hp).left.location);
@ -288,7 +290,10 @@ begin
end. end.
{ {
$Log$ $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 * generic constructor working for i386
* remove fixed self register * remove fixed self register
* esi added as address register for i386 * esi added as address register for i386

View File

@ -136,7 +136,9 @@ implementation
aktcontinuelabel:=lcont; aktcontinuelabel:=lcont;
aktbreaklabel:=lbreak; aktbreaklabel:=lbreak;
{$ifndef newra}
rg.cleartempgen; rg.cleartempgen;
{$endif}
if assigned(right) then if assigned(right) then
secondpass(right); secondpass(right);
@ -155,7 +157,9 @@ implementation
truelabel:=lloop; truelabel:=lloop;
falselabel:=lbreak; falselabel:=lbreak;
end; end;
{$ifndef newra}
rg.cleartempgen; rg.cleartempgen;
{$endif}
secondpass(left); secondpass(left);
maketojumpbool(exprasmlist,left,lr_load_regvars); maketojumpbool(exprasmlist,left,lr_load_regvars);
@ -190,7 +194,9 @@ implementation
oflabel:=falselabel; oflabel:=falselabel;
objectlibrary.getlabel(truelabel); objectlibrary.getlabel(truelabel);
objectlibrary.getlabel(falselabel); objectlibrary.getlabel(falselabel);
{$ifndef newra}
rg.cleartempgen; rg.cleartempgen;
{$endif}
secondpass(left); secondpass(left);
@ -209,7 +215,9 @@ implementation
if assigned(right) then if assigned(right) then
begin begin
cg.a_label(exprasmlist,truelabel); cg.a_label(exprasmlist,truelabel);
{$ifndef newra}
rg.cleartempgen; rg.cleartempgen;
{$endif}
secondpass(right); secondpass(right);
end; end;
@ -236,7 +244,9 @@ implementation
cg.a_jmp_always(exprasmlist,hl); cg.a_jmp_always(exprasmlist,hl);
end; end;
cg.a_label(exprasmlist,falselabel); cg.a_label(exprasmlist,falselabel);
{$ifndef newra}
rg.cleartempgen; rg.cleartempgen;
{$endif}
secondpass(t1); secondpass(t1);
{ save current asmlist (previous instructions + else-block) } { save current asmlist (previous instructions + else-block) }
{ and loaded regvar state and create a new clean list } { and loaded regvar state and create a new clean list }
@ -319,14 +329,18 @@ implementation
objectlibrary.getlabel(l3); objectlibrary.getlabel(l3);
{ only calculate reference } { only calculate reference }
{$ifndef newra}
rg.cleartempgen; rg.cleartempgen;
{$endif}
secondpass(t2); secondpass(t2);
hs := t2.resulttype.def.size; hs := t2.resulttype.def.size;
opsize := def_cgsize(t2.resulttype.def); opsize := def_cgsize(t2.resulttype.def);
{ first set the to value { first set the to value
because the count var can be in the expression !! } because the count var can be in the expression !! }
{$ifndef newra}
rg.cleartempgen; rg.cleartempgen;
{$endif}
do_loopvar_at_end:=lnf_dont_mind_loopvar_on_exit in loopflags; do_loopvar_at_end:=lnf_dont_mind_loopvar_on_exit in loopflags;
@ -353,7 +367,9 @@ implementation
temptovalue:=false; temptovalue:=false;
{ produce start assignment } { produce start assignment }
{$ifndef newra}
rg.cleartempgen; rg.cleartempgen;
{$endif}
secondpass(left); secondpass(left);
count_var_is_signed:=is_signed(t2.resulttype.def); count_var_is_signed:=is_signed(t2.resulttype.def);
@ -415,7 +431,9 @@ implementation
end; end;
{ help register must not be in instruction block } { help register must not be in instruction block }
{$ifndef newra}
rg.cleartempgen; rg.cleartempgen;
{$endif}
if assigned(t1) then if assigned(t1) then
begin begin
secondpass(t1); secondpass(t1);
@ -437,7 +455,9 @@ implementation
cg.a_label(exprasmlist,aktcontinuelabel); cg.a_label(exprasmlist,aktcontinuelabel);
{ makes no problems there } { makes no problems there }
{$ifndef newra}
rg.cleartempgen; rg.cleartempgen;
{$endif}
if do_loopvar_at_end then if do_loopvar_at_end then
if lnf_backward in loopflags then if lnf_backward in loopflags then
@ -857,7 +877,9 @@ implementation
begin begin
load_all_regvars(exprasmlist); load_all_regvars(exprasmlist);
cg.a_label(exprasmlist,labelnr); cg.a_label(exprasmlist,labelnr);
{$ifndef newra}
rg.cleartempgen; rg.cleartempgen;
{$endif newra}
secondpass(left); secondpass(left);
end; end;
@ -1322,7 +1344,9 @@ implementation
{ next on node } { next on node }
if assigned(left) then if assigned(left) then
begin begin
{$ifndef newra}
rg.cleartempgen; rg.cleartempgen;
{$endif newra}
secondpass(left); secondpass(left);
end; end;
end; end;
@ -1483,7 +1507,10 @@ begin
end. end.
{ {
$Log$ $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 * changed newasmsymbol to newasmsymboldata for data symbols
Revision 1.52 2003/03/28 19:16:56 peter Revision 1.52 2003/03/28 19:16:56 peter

View File

@ -372,6 +372,9 @@ implementation
aktprocdef.usedotherregisters:=rg.usedinproc; aktprocdef.usedotherregisters:=rg.usedinproc;
procinfo.aktproccode.insertlist(procinfo.aktentrycode); procinfo.aktproccode.insertlist(procinfo.aktentrycode);
procinfo.aktproccode.concatlist(procinfo.aktexitcode); procinfo.aktproccode.concatlist(procinfo.aktexitcode);
{$ifdef newra}
rg.writegraph;
{$endif}
if not(cs_no_regalloc in aktglobalswitches) then if not(cs_no_regalloc in aktglobalswitches) then
begin begin
procinfo.aktproccode.convert_registers; procinfo.aktproccode.convert_registers;
@ -864,7 +867,10 @@ implementation
end. end.
{ {
$Log$ $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 * assembler procedures now again get a stackframe if they have local
variables. No space is reserved for a function result however. variables. No space is reserved for a function result however.
Also, the register parameters aren't automatically saved on the stack Also, the register parameters aren't automatically saved on the stack

View File

@ -285,6 +285,9 @@ unit rgobj;
procedure saveUnusedState(var state: pointer);virtual; procedure saveUnusedState(var state: pointer);virtual;
procedure restoreUnusedState(var state: pointer);virtual; procedure restoreUnusedState(var state: pointer);virtual;
{$ifdef newra}
procedure writegraph;
{$endif}
protected protected
{$ifdef newra} {$ifdef newra}
igraph:Tinterferencegraph; igraph:Tinterferencegraph;
@ -535,6 +538,9 @@ unit rgobj;
inc(countunusedregs); inc(countunusedregs);
include(unusedregs,supreg); include(unusedregs,supreg);
list.concat(tai_regalloc.dealloc(r)); list.concat(tai_regalloc.dealloc(r));
{$ifdef newra}
add_edges_used(supreg);
{$endif newra}
end; end;
@ -1211,6 +1217,38 @@ unit rgobj;
if not(i in unusedregsint) then if not(i in unusedregsint) then
add_edge(u,i); add_edge(u,i);
end; 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} {$endif}
@ -1343,7 +1381,10 @@ end.
{ {
$Log$ $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 * generic constructor working for i386
* remove fixed self register * remove fixed self register
* esi added as address register for i386 * esi added as address register for i386