aboutsummaryrefslogtreecommitdiffstats
path: root/lib/hipe/x86/hipe_x86_ra_finalise.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_finalise.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_finalise.erl')
-rw-r--r--lib/hipe/x86/hipe_x86_ra_finalise.erl15
1 files changed, 14 insertions, 1 deletions
diff --git a/lib/hipe/x86/hipe_x86_ra_finalise.erl b/lib/hipe/x86/hipe_x86_ra_finalise.erl
index 5dd75cb7ae..647d67eeeb 100644
--- a/lib/hipe/x86/hipe_x86_ra_finalise.erl
+++ b/lib/hipe/x86/hipe_x86_ra_finalise.erl
@@ -25,10 +25,13 @@
-define(HIPE_X86_RA_FINALISE, hipe_amd64_ra_finalise).
-define(HIPE_X86_REGISTERS, hipe_amd64_registers).
-define(HIPE_X86_X87, hipe_amd64_x87).
+-define(HIPE_X86_SSE2, hipe_amd64_sse2).
+-define(IF_HAS_SSE2(Expr), Expr).
-else.
-define(HIPE_X86_RA_FINALISE, hipe_x86_ra_finalise).
-define(HIPE_X86_REGISTERS, hipe_x86_registers).
-define(HIPE_X86_X87, hipe_x86_x87).
+-define(IF_HAS_SSE2(Expr),).
-endif.
-module(?HIPE_X86_RA_FINALISE).
@@ -41,7 +44,17 @@ finalise(Defun, TempMap, FpMap, Options) ->
true ->
?HIPE_X86_X87:map(Defun1);
_ ->
- Defun1
+ case
+ proplists:get_bool(inline_fp, Options)
+ and (proplists:get_value(regalloc, Options) =:= linear_scan)
+ of
+ %% Ugly, but required to avoid Dialyzer complaints about "Unknown
+ %% function" hipe_x86_sse2:map/1
+ ?IF_HAS_SSE2(true ->
+ ?HIPE_X86_SSE2:map(Defun1);)
+ false ->
+ Defun1
+ end
end.
%%%