2
0
Эх сурвалжийг харах

+ New subtype of tai_regalloc, "ra_markused". It marks a physical register as used in procedure, triggering saving/restoring that register if it is non-volatile.

git-svn-id: trunk@30010 -
sergei 10 жил өмнө
parent
commit
31fddaafe8

+ 12 - 2
compiler/aasmtai.pas

@@ -334,7 +334,7 @@ interface
         mark_Position
         mark_Position
       );
       );
 
 
-      TRegAllocType = (ra_alloc,ra_dealloc,ra_sync,ra_resize);
+      TRegAllocType = (ra_alloc,ra_dealloc,ra_sync,ra_resize,ra_markused);
 
 
       TStabType = (stab_stabs,stab_stabn,stab_stabd,
       TStabType = (stab_stabs,stab_stabn,stab_stabd,
                    { AIX/XCOFF stab types }
                    { AIX/XCOFF stab types }
@@ -371,7 +371,7 @@ interface
 
 
 
 
     const
     const
-      regallocstr : array[tregalloctype] of string[10]=('allocated','released','sync','resized');
+      regallocstr : array[tregalloctype] of string[10]=('allocated','released','sync','resized','used');
       tempallocstr : array[boolean] of string[10]=('released','allocated');
       tempallocstr : array[boolean] of string[10]=('released','allocated');
       stabtypestr : array[TStabType] of string[8]=(
       stabtypestr : array[TStabType] of string[8]=(
         'stabs','stabn','stabd',
         'stabs','stabn','stabd',
@@ -714,6 +714,7 @@ interface
           constructor dealloc(r : tregister;ainstr:tai);
           constructor dealloc(r : tregister;ainstr:tai);
           constructor sync(r : tregister);
           constructor sync(r : tregister);
           constructor resize(r : tregister);
           constructor resize(r : tregister);
+          constructor markused(r : tregister);
           constructor ppuload(t:taitype;ppufile:tcompilerppufile);override;
           constructor ppuload(t:taitype;ppufile:tcompilerppufile);override;
           procedure ppuwrite(ppufile:tcompilerppufile);override;
           procedure ppuwrite(ppufile:tcompilerppufile);override;
        end;
        end;
@@ -2424,6 +2425,15 @@ implementation
       end;
       end;
 
 
 
 
+    constructor tai_regalloc.markused(r : tregister);
+      begin
+        inherited create;
+        typ:=ait_regalloc;
+        ratype:=ra_markused;
+        reg:=r;
+      end;
+
+
     constructor tai_regalloc.ppuload(t:taitype;ppufile:tcompilerppufile);
     constructor tai_regalloc.ppuload(t:taitype;ppufile:tcompilerppufile);
       begin
       begin
         inherited ppuload(t,ppufile);
         inherited ppuload(t,ppufile);

+ 3 - 0
compiler/rgobj.pas

@@ -1683,6 +1683,9 @@ unit rgobj;
 {$endif DEBUG_REGISTERLIFE}
 {$endif DEBUG_REGISTERLIFE}
                             add_edges_used(supreg);
                             add_edges_used(supreg);
                           end;
                           end;
+                        ra_markused :
+                          if (supreg<first_imaginary) then
+                            include(used_in_proc,supreg);
                       end;
                       end;
                       { constraints needs always to be updated }
                       { constraints needs always to be updated }
                       add_constraints(reg);
                       add_constraints(reg);