Browse Source

* fixed LLVM register allocator after r46199

git-svn-id: trunk@46212 -
Jonas Maebe 5 years ago
parent
commit
3047ce71bc
2 changed files with 6 additions and 1 deletions
  1. 5 0
      compiler/llvm/rgllvm.pas
  2. 1 1
      compiler/rgobj.pas

+ 5 - 0
compiler/llvm/rgllvm.pas

@@ -72,6 +72,11 @@ implementation
          inherited;
          inherited;
          { tell the generic register allocator to generate SSA spilling code }
          { tell the generic register allocator to generate SSA spilling code }
          ssa_safe:=true;
          ssa_safe:=true;
+         { all registers are "usable" for us; we only care about SSA form. This
+           prevents the register allocator from trying to spill every single
+           register (because our "usable registers" array contains just one,
+           dummy, register) }
+         usable_registers_cnt:=high(usable_registers_cnt);
        end;
        end;
 
 
      procedure trgllvm.do_register_allocation(list: TAsmList; headertai: tai);
      procedure trgllvm.do_register_allocation(list: TAsmList; headertai: tai);

+ 1 - 1
compiler/rgobj.pas

@@ -226,11 +226,11 @@ unit rgobj;
       strict protected
       strict protected
         { Highest register allocated until now.}
         { Highest register allocated until now.}
         reginfo           : PReginfo;
         reginfo           : PReginfo;
+        usable_registers_cnt : word;
       private
       private
         int_live_range_direction: TRADirection;
         int_live_range_direction: TRADirection;
         { First imaginary register.}
         { First imaginary register.}
         first_imaginary   : Tsuperregister;
         first_imaginary   : Tsuperregister;
-        usable_registers_cnt : word;
         usable_registers  : array[0..maxcpuregister] of tsuperregister;
         usable_registers  : array[0..maxcpuregister] of tsuperregister;
         usable_register_set : tcpuregisterset;
         usable_register_set : tcpuregisterset;
         ibitmap           : Tinterferencebitmap;
         ibitmap           : Tinterferencebitmap;