diff options
author | Magnus Lång <[email protected]> | 2016-05-28 20:22:34 +0200 |
---|---|---|
committer | Magnus Lång <[email protected]> | 2016-09-02 15:04:45 +0200 |
commit | 85bd166647e7f260fd665eb44da9151c0d88f208 (patch) | |
tree | 84878ab624fcc22246bae89b75a6857415508539 /lib/hipe/sparc/hipe_sparc_defuse.erl | |
parent | c2f8b61ca3682281752fa0984699214dfcbf7ccd (diff) | |
download | otp-85bd166647e7f260fd665eb44da9151c0d88f208.tar.gz otp-85bd166647e7f260fd665eb44da9151c0d88f208.tar.bz2 otp-85bd166647e7f260fd665eb44da9151c0d88f208.zip |
hipe: Add hipe_regalloc_prepass
hipe_regalloc_prepass speeds up register allocation by spilling any temp
that is live over a call (which clobbers all register).
In order to detect these, a new function was added to the target
interface; defines_all_alloc/1, that takes an instruction and returns a
boolean.
Diffstat (limited to 'lib/hipe/sparc/hipe_sparc_defuse.erl')
-rw-r--r-- | lib/hipe/sparc/hipe_sparc_defuse.erl | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/lib/hipe/sparc/hipe_sparc_defuse.erl b/lib/hipe/sparc/hipe_sparc_defuse.erl index 4f66299f1d..4b5a19a19d 100644 --- a/lib/hipe/sparc/hipe_sparc_defuse.erl +++ b/lib/hipe/sparc/hipe_sparc_defuse.erl @@ -23,6 +23,7 @@ -export([insn_def_all/1, insn_use_all/1]). -export([insn_def_gpr/1, insn_use_gpr/1]). -export([insn_def_fpr/1, insn_use_fpr/1]). +-export([insn_defs_all_gpr/1, insn_defs_all_fpr/1]). -include("hipe_sparc.hrl"). %%% @@ -51,6 +52,12 @@ insn_def_gpr(I) -> _ -> [] end. +insn_defs_all_gpr(I) -> + case I of + #pseudo_call{} -> true; + _ -> false + end. + call_clobbered_gpr() -> [hipe_sparc:mk_temp(R, T) || {R,T} <- hipe_sparc_registers:call_clobbered() ++ all_fp_pseudos()]. @@ -115,6 +122,12 @@ insn_def_fpr(I) -> _ -> [] end. +insn_defs_all_fpr(I) -> + case I of + #pseudo_call{} -> true; + _ -> false + end. + call_clobbered_fpr() -> [hipe_sparc:mk_temp(R, 'double') || R <- hipe_sparc_registers:allocatable_fpr()]. |