Browse Source

* Use a normal pascal set in assign_colours, since it only will contain
real registers

daniel 21 years ago
parent
commit
649bd81edb
1 changed files with 17 additions and 13 deletions
  1. 17 13
      compiler/rgobj.pas

+ 17 - 13
compiler/rgobj.pas

@@ -1254,8 +1254,8 @@ unit rgobj;
     var adj : Psuperregisterworklist;
     var adj : Psuperregisterworklist;
         i,j,k : word;
         i,j,k : word;
         n,a,c : Tsuperregister;
         n,a,c : Tsuperregister;
-        adj_colours,
         colourednodes : Tsuperregisterset;
         colourednodes : Tsuperregisterset;
+		adj_colours:set of 0..255;
         found : boolean;
         found : boolean;
 
 
     begin
     begin
@@ -1272,30 +1272,30 @@ unit rgobj;
         begin
         begin
           n:=selectstack.buf^[i-1];
           n:=selectstack.buf^[i-1];
           {Create a list of colours that we cannot assign to n.}
           {Create a list of colours that we cannot assign to n.}
-          supregset_reset(adj_colours,false,maxreg);
+          adj_colours:=[];
           adj:=reginfo[n].adjlist;
           adj:=reginfo[n].adjlist;
           if adj<>nil then
           if adj<>nil then
             for j:=0 to adj^.length-1 do
             for j:=0 to adj^.length-1 do
               begin
               begin
                 a:=get_alias(adj^.buf^[j]);
                 a:=get_alias(adj^.buf^[j]);
                 if supregset_in(colourednodes,a) then
                 if supregset_in(colourednodes,a) then
-                  supregset_include(adj_colours,reginfo[a].colour);
+                  include(adj_colours,reginfo[a].colour);
               end;
               end;
-            supregset_include(adj_colours,RS_STACK_POINTER_REG);
+          include(adj_colours,RS_STACK_POINTER_REG);
           {Assume a spill by default...}
           {Assume a spill by default...}
           found:=false;
           found:=false;
           {Search for a colour not in this list.}
           {Search for a colour not in this list.}
           for k:=0 to usable_registers_cnt-1 do
           for k:=0 to usable_registers_cnt-1 do
             begin
             begin
               c:=usable_registers[k];
               c:=usable_registers[k];
-              if not(supregset_in(adj_colours,c)) then
-                begin
-                  reginfo[n].colour:=c;
-                  found:=true;
-                  supregset_include(colourednodes,n);
-                  include(used_in_proc,c);
-                  break;
-                end;
+               if not(c in adj_colours) then
+                 begin
+                   reginfo[n].colour:=c;
+                   found:=true;
+                   supregset_include(colourednodes,n);
+                   include(used_in_proc,c);
+                   break;
+                 end;
             end;
             end;
           if not found then
           if not found then
             spillednodes.add(n);
             spillednodes.add(n);
@@ -1986,7 +1986,11 @@ unit rgobj;
 end.
 end.
 {
 {
   $Log$
   $Log$
-  Revision 1.131  2004-07-07 17:35:26  daniel
+  Revision 1.132  2004-07-08 09:57:55  daniel
+    * Use a normal pascal set in assign_colours, since it only will contain
+      real registers
+
+  Revision 1.131  2004/07/07 17:35:26  daniel
     * supregset_reset clears 8kb of memory. However, it is being called in
     * supregset_reset clears 8kb of memory. However, it is being called in
       inner loops, see for example colour_registers. According to profile data
       inner loops, see for example colour_registers. According to profile data
       this causes fillchar to be the most time consuming procedure.
       this causes fillchar to be the most time consuming procedure.