aboutsummaryrefslogtreecommitdiffstats
path: root/lib/hipe/x86/hipe_x86_ra.erl
diff options
context:
space:
mode:
authorMagnus Lång <[email protected]>2016-03-12 01:22:45 +0100
committerMagnus Lång <[email protected]>2016-08-30 17:02:37 +0200
commitd93a42112b35e4dbfb0f34b413fffb543f15ca3e (patch)
tree1de60981f1c99cfc66fa7e911063f1cc4ee58679 /lib/hipe/x86/hipe_x86_ra.erl
parent85234b4069c9b75e3ae5ddf643b981d7428fb81f (diff)
downloadotp-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.erl')
-rw-r--r--lib/hipe/x86/hipe_x86_ra.erl38
1 files changed, 24 insertions, 14 deletions
diff --git a/lib/hipe/x86/hipe_x86_ra.erl b/lib/hipe/x86/hipe_x86_ra.erl
index f66961a7a7..d47ba532fe 100644
--- a/lib/hipe/x86/hipe_x86_ra.erl
+++ b/lib/hipe/x86/hipe_x86_ra.erl
@@ -75,25 +75,35 @@ ra(Defun, SpillIndex, Options, RegAllocMod) ->
-ifdef(HIPE_AMD64).
ra_fp(Defun, Options) ->
- case proplists:get_bool(inline_fp, Options) and
- (proplists:get_value(regalloc, Options) =/= naive) of
- true ->
- case proplists:get_bool(x87, Options) of
- true ->
- hipe_amd64_ra_x87_ls:ra(Defun, Options);
- false ->
- hipe_regalloc_loop:ra_fp(Defun, Options,
- hipe_coalescing_regalloc,
- hipe_amd64_specific_sse2)
- end;
- false ->
- {Defun,[],0}
+ Regalloc0 = proplists:get_value(regalloc, Options),
+ {Regalloc, TargetMod} =
+ case proplists:get_bool(inline_fp, Options) and (Regalloc0 =/= naive) of
+ false -> {naive, undefined};
+ true ->
+ case proplists:get_bool(x87, Options) of
+ true -> {linear_scan, hipe_amd64_specific_x87};
+ false -> {Regalloc0, hipe_amd64_specific_sse2}
+ end
+ end,
+ case Regalloc of
+ coalescing -> ra_fp(Defun, Options, hipe_coalescing_regalloc, TargetMod);
+ optimistic -> ra_fp(Defun, Options, hipe_optimistic_regalloc, TargetMod);
+ graph_color -> ra_fp(Defun, Options, hipe_graph_coloring_regalloc,
+ TargetMod);
+ linear_scan -> hipe_amd64_ra_ls:ra_fp(Defun, Options, TargetMod);
+ naive -> {Defun,[],0};
+ _ ->
+ exit({unknown_regalloc_compiler_option,
+ proplists:get_value(regalloc,Options)})
end.
+
+ra_fp(Defun, Options, RegAllocMod, TargetMod) ->
+ hipe_regalloc_loop:ra_fp(Defun, Options, RegAllocMod, TargetMod).
-else.
ra_fp(Defun, Options) ->
case proplists:get_bool(inline_fp, Options) of
true ->
- hipe_x86_ra_x87_ls:ra(Defun, Options);
+ hipe_x86_ra_ls:ra_fp(Defun, Options, hipe_x86_specific_x87);
false ->
{Defun,[],0}
end.