aboutsummaryrefslogtreecommitdiffstats
path: root/lib/hipe/x86/hipe_x86_ra.erl
diff options
context:
space:
mode:
authorMagnus Lång <[email protected]>2016-09-05 14:55:01 +0200
committerMagnus Lång <[email protected]>2016-09-05 19:17:50 +0200
commitea710644b198f7800f0daf2de0d152cf8e3e9bb3 (patch)
tree46842f5dab3fcdbb4055d11ee55c28506eeac7fc /lib/hipe/x86/hipe_x86_ra.erl
parent1039c0196a7e643c63ce71b2c6daa2b78b3aa832 (diff)
downloadotp-ea710644b198f7800f0daf2de0d152cf8e3e9bb3.tar.gz
otp-ea710644b198f7800f0daf2de0d152cf8e3e9bb3.tar.bz2
otp-ea710644b198f7800f0daf2de0d152cf8e3e9bb3.zip
hipe: Refactor ra callbacks to accept context arg
This allows us to pass around the context data that hipe_regalloc_prepass needs cleanly, without using process dictionary or parameterised modules (like it was previous to this change).
Diffstat (limited to 'lib/hipe/x86/hipe_x86_ra.erl')
-rw-r--r--lib/hipe/x86/hipe_x86_ra.erl13
1 files changed, 8 insertions, 5 deletions
diff --git a/lib/hipe/x86/hipe_x86_ra.erl b/lib/hipe/x86/hipe_x86_ra.erl
index 1a860bebb1..b64c22a76c 100644
--- a/lib/hipe/x86/hipe_x86_ra.erl
+++ b/lib/hipe/x86/hipe_x86_ra.erl
@@ -49,7 +49,7 @@ code_size(CFG) ->
ra(CFG0, Options) ->
%% hipe_x86_cfg:pp(CFG0),
- Liveness0 = ?HIPE_X86_SPECIFIC:analyze(CFG0),
+ Liveness0 = ?HIPE_X86_SPECIFIC:analyze(CFG0, no_context),
{CFG1, Liveness, Coloring_fp, SpillIndex} = ra_fp(CFG0, Liveness0, Options),
%% hipe_x86_cfg:pp(CFG1),
?start_ra_instrumentation(Options,
@@ -79,7 +79,7 @@ ra(CFG0, Options) ->
ra(CFG, Liveness, SpillIndex, Options, RegAllocMod) ->
hipe_regalloc_loop:ra(CFG, Liveness, SpillIndex, Options, RegAllocMod,
- ?HIPE_X86_SPECIFIC).
+ ?HIPE_X86_SPECIFIC, no_context).
-ifdef(HIPE_AMD64).
ra_fp(CFG, Liveness, Options) ->
@@ -100,7 +100,8 @@ ra_fp(CFG, Liveness, Options) ->
ra_fp(CFG, Liveness, Options, hipe_optimistic_regalloc, TargetMod);
graph_color ->
ra_fp(CFG, Liveness, Options, hipe_graph_coloring_regalloc, TargetMod);
- linear_scan -> hipe_amd64_ra_ls:ra_fp(CFG, Liveness, Options, TargetMod);
+ linear_scan -> hipe_amd64_ra_ls:ra_fp(CFG, Liveness, Options, TargetMod,
+ no_context);
naive -> {CFG,Liveness,[],0};
_ ->
exit({unknown_regalloc_compiler_option,
@@ -108,12 +109,14 @@ ra_fp(CFG, Liveness, Options) ->
end.
ra_fp(CFG, Liveness, Options, RegAllocMod, TargetMod) ->
- hipe_regalloc_loop:ra_fp(CFG, Liveness, Options, RegAllocMod, TargetMod).
+ hipe_regalloc_loop:ra_fp(CFG, Liveness, Options, RegAllocMod, TargetMod,
+ no_context).
-else.
ra_fp(CFG, Liveness, Options) ->
case proplists:get_bool(inline_fp, Options) of
true ->
- hipe_x86_ra_ls:ra_fp(CFG, Liveness, Options, hipe_x86_specific_x87);
+ hipe_x86_ra_ls:ra_fp(CFG, Liveness, Options, hipe_x86_specific_x87,
+ no_context);
false ->
{CFG,Liveness,[],0}
end.