Skip to content

Commit

Permalink
[arm] Improve register pressure for interval splitting.
Browse files Browse the repository at this point in the history
git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@13168 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
  • Loading branch information
bmeurer committed Dec 28, 2012
1 parent 655cf17 commit 9ae4584
Showing 1 changed file with 12 additions and 6 deletions.
18 changes: 12 additions & 6 deletions asmcomp/arm/proc.ml
Original file line number Diff line number Diff line change
Expand Up @@ -192,29 +192,35 @@ let destroyed_at_c_call =
124;125;126;127;128;129;130;131]))

let destroyed_at_oper = function
Iop(Icall_ind | Icall_imm _ )
Iop(Icall_ind | Icall_imm _)
| Iop(Iextcall(_, true)) ->
all_phys_regs
| Iop(Iextcall(_, false)) ->
destroyed_at_c_call
| Iop(Ialloc n) ->
| Iop(Ialloc _) ->
destroyed_at_alloc
| Iop(Iconst_symbol _) when !pic_code ->
[|phys_reg 3; phys_reg 8|] (* r3 and r12 destroyed *)
[| phys_reg 3; phys_reg 8 |] (* r3 and r12 destroyed *)
| Iop(Iintoffloat | Ifloatofint | Iload(Single, _) | Istore(Single, _)) ->
[|phys_reg 107|] (* d7 (s14-s15) destroyed *)
[| phys_reg 107 |] (* d7 (s14-s15) destroyed *)
| _ -> [||]

let destroyed_at_raise = all_phys_regs

(* Maximal register pressure *)

let safe_register_pressure = function
Iextcall(_, _) -> 5
Iextcall(_, _) -> if abi = EABI then 0 else 4
| Ialloc _ -> if abi = EABI then 0 else 7
| Iconst_symbol _ when !pic_code -> 7
| _ -> 9

let max_register_pressure = function
Iextcall(_, _) -> [| 5; 9; 9 |]
Iextcall(_, _) -> if abi = EABI then [| 4; 0; 0 |] else [| 4; 8; 8 |]
| Ialloc _ -> if abi = EABI then [| 7; 0; 0 |] else [| 7; 8; 8 |]
| Iconst_symbol _ when !pic_code -> [| 7; 16; 32 |]
| Iintoffloat | Ifloatofint
| Iload(Single, _) | Istore(Single, _) -> [| 9; 15; 31 |]
| _ -> [| 9; 16; 32 |]

(* Layout of the stack *)
Expand Down

0 comments on commit 9ae4584

Please sign in to comment.