diff options
author | Magnus Lång <[email protected]> | 2016-03-12 01:22:45 +0100 |
---|---|---|
committer | Magnus Lång <[email protected]> | 2016-08-30 17:02:37 +0200 |
commit | d93a42112b35e4dbfb0f34b413fffb543f15ca3e (patch) | |
tree | 1de60981f1c99cfc66fa7e911063f1cc4ee58679 /lib/hipe/x86/hipe_x86_ra_ls.erl | |
parent | 85234b4069c9b75e3ae5ddf643b981d7428fb81f (diff) | |
download | otp-d93a42112b35e4dbfb0f34b413fffb543f15ca3e.tar.gz otp-d93a42112b35e4dbfb0f34b413fffb543f15ca3e.tar.bz2 otp-d93a42112b35e4dbfb0f34b413fffb543f15ca3e.zip |
hipe_x86: LSRA for SSE2
There is little point offering LSRA for x86 if we're still going to call
hipe_graph_coloring_regalloc for the floats. In particular, all
allocators except LSRA allocates an N^2 interference matrix, making them
unusable for really large functions.
Diffstat (limited to 'lib/hipe/x86/hipe_x86_ra_ls.erl')
-rw-r--r-- | lib/hipe/x86/hipe_x86_ra_ls.erl | 31 |
1 files changed, 30 insertions, 1 deletions
diff --git a/lib/hipe/x86/hipe_x86_ra_ls.erl b/lib/hipe/x86/hipe_x86_ra_ls.erl index 3e34433111..8cd51481dd 100644 --- a/lib/hipe/x86/hipe_x86_ra_ls.erl +++ b/lib/hipe/x86/hipe_x86_ra_ls.erl @@ -35,7 +35,7 @@ -endif. -module(?HIPE_X86_RA_LS). --export([ra/3,regalloc/7]). +-export([ra/3,ra_fp/3,regalloc/7]). -define(HIPE_INSTRUMENT_COMPILER, true). %% Turn on instrumentation. -include("../main/hipe.hrl"). @@ -48,6 +48,35 @@ ra(Defun, SpillIndex, Options) -> ?inc_counter(bbs_counter, length(hipe_x86_cfg:labels(CFG))), alloc(NewDefun, SpillIndex, SpillLimit, Options). +ra_fp(Defun, Options, TargetMod) -> + ?inc_counter(ra_calls_counter,1), + CFG = hipe_x86_cfg:init(Defun), + %% ?inc_counter(ra_caller_saves_counter,count_caller_saves(CFG)), + SpillIndex = 0, + SpillLimit = TargetMod:number_of_temporaries(CFG), + ?inc_counter(bbs_counter, length(hipe_x86_cfg:labels(CFG))), + + ?inc_counter(ra_iteration_counter,1), + %% ?HIPE_X86_PP:pp(Defun), + Cfg = hipe_x86_cfg:init(Defun), % XXX: didn't we just compute this above? + + {Coloring,NewSpillIndex} = + regalloc(Cfg, + TargetMod:allocatable('linearscan'), + [hipe_x86_cfg:start_label(Cfg)], + SpillIndex, SpillLimit, Options, + TargetMod), + + {NewDefun, _DidSpill} = + TargetMod:check_and_rewrite(Defun, Coloring, 'linearscan'), + TempMap = hipe_temp_map:cols2tuple(Coloring, TargetMod), + {TempMap2, NewSpillIndex2} = + hipe_spillmin:stackalloc(CFG, [], SpillIndex, Options, + TargetMod, TempMap), + Coloring2 = + hipe_spillmin:mapmerge(hipe_temp_map:to_substlist(TempMap), TempMap2), + ?add_spills(Options, NewSpillIndex), + {NewDefun, Coloring2, NewSpillIndex2}. alloc(Defun, SpillIndex, SpillLimit, Options) -> ?inc_counter(ra_iteration_counter,1), |