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/x86/hipe_x86_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/x86/hipe_x86_defuse.erl')
-rw-r--r-- | lib/hipe/x86/hipe_x86_defuse.erl | 12 |
1 files changed, 11 insertions, 1 deletions
diff --git a/lib/hipe/x86/hipe_x86_defuse.erl b/lib/hipe/x86/hipe_x86_defuse.erl index 9cba6cbe4b..4455def74e 100644 --- a/lib/hipe/x86/hipe_x86_defuse.erl +++ b/lib/hipe/x86/hipe_x86_defuse.erl @@ -35,7 +35,7 @@ -endif. -module(?HIPE_X86_DEFUSE). --export([insn_def/1, insn_use/1]). %% src_use/1]). +-export([insn_def/1, insn_defs_all/1, insn_use/1]). %% src_use/1]). -include("../x86/hipe_x86.hrl"). %%% @@ -64,6 +64,16 @@ insn_def(I) -> _ -> [] end. + +%% @doc Answers whether instruction I defines all allocatable registers. Used by +%% hipe_regalloc_prepass. +-spec insn_defs_all(_) -> boolean(). +insn_defs_all(I) -> + case I of + #pseudo_call{} -> true; + _ -> false + end. + dst_def(Dst) -> case Dst of #x86_temp{} -> [Dst]; |