aboutsummaryrefslogtreecommitdiffstats
path: root/lib/hipe/regalloc/hipe_regalloc_loop.erl
diff options
context:
space:
mode:
authorMagnus Lång <[email protected]>2016-06-16 17:09:13 +0200
committerMagnus Lång <[email protected]>2016-09-02 15:59:17 +0200
commit86eeae878efbbcfb12245cdab992bb39987f09bf (patch)
treeba4befb9ea600fabf88cdcd1a8dd924e003d9141 /lib/hipe/regalloc/hipe_regalloc_loop.erl
parentdcfd9d92a4dce86e9a78b6152523a6eb305e8a6d (diff)
downloadotp-86eeae878efbbcfb12245cdab992bb39987f09bf.tar.gz
otp-86eeae878efbbcfb12245cdab992bb39987f09bf.tar.bz2
otp-86eeae878efbbcfb12245cdab992bb39987f09bf.zip
hipe: Remove defun_to_cfg/1 RA callback
Now that all backends do register allocation on a CFG directly and define the defun_to_cfg/1 callback as the identity function, it can be removed.
Diffstat (limited to 'lib/hipe/regalloc/hipe_regalloc_loop.erl')
-rw-r--r--lib/hipe/regalloc/hipe_regalloc_loop.erl26
1 files changed, 12 insertions, 14 deletions
diff --git a/lib/hipe/regalloc/hipe_regalloc_loop.erl b/lib/hipe/regalloc/hipe_regalloc_loop.erl
index 4a933a890c..34662200e5 100644
--- a/lib/hipe/regalloc/hipe_regalloc_loop.erl
+++ b/lib/hipe/regalloc/hipe_regalloc_loop.erl
@@ -26,21 +26,20 @@
%%-define(HIPE_INSTRUMENT_COMPILER, true). %% Turn on instrumentation.
-include("../main/hipe.hrl").
-ra(Defun, SpillIndex, Options, RegAllocMod, TargetMod) ->
- {NewDefun, Coloring, _NewSpillIndex} =
- ra_common(Defun, SpillIndex, Options, RegAllocMod, TargetMod),
- {NewDefun, Coloring}.
+ra(CFG, SpillIndex, Options, RegAllocMod, TargetMod) ->
+ {NewCFG, Coloring, _NewSpillIndex} =
+ ra_common(CFG, SpillIndex, Options, RegAllocMod, TargetMod),
+ {NewCFG, Coloring}.
-ra_fp(Defun, Options, RegAllocMod, TargetMod) ->
- ra_common(Defun, 0, Options, RegAllocMod, TargetMod).
+ra_fp(CFG, Options, RegAllocMod, TargetMod) ->
+ ra_common(CFG, 0, Options, RegAllocMod, TargetMod).
-ra_common(Defun, SpillIndex, Options, RegAllocMod, TargetMod) ->
+ra_common(CFG, SpillIndex, Options, RegAllocMod, TargetMod) ->
?inc_counter(ra_calls_counter, 1),
- CFG = TargetMod:defun_to_cfg(Defun),
SpillLimit = TargetMod:number_of_temporaries(CFG),
- alloc(Defun, CFG, SpillLimit, SpillIndex, Options, RegAllocMod, TargetMod).
+ alloc(CFG, SpillLimit, SpillIndex, Options, RegAllocMod, TargetMod).
-alloc(Defun, CFG, SpillLimit, SpillIndex, Options, RegAllocMod, TargetMod) ->
+alloc(CFG, SpillLimit, SpillIndex, Options, RegAllocMod, TargetMod) ->
?inc_counter(ra_iteration_counter, 1),
{Coloring, _NewSpillIndex, Liveness} =
case proplists:get_bool(ra_prespill, Options) of
@@ -50,7 +49,7 @@ alloc(Defun, CFG, SpillLimit, SpillIndex, Options, RegAllocMod, TargetMod) ->
false ->
RegAllocMod:regalloc(CFG, SpillIndex, SpillLimit, TargetMod, Options)
end,
- {NewDefun, DidSpill} = TargetMod:check_and_rewrite(Defun, Coloring),
+ {NewCFG, DidSpill} = TargetMod:check_and_rewrite(CFG, Coloring),
case DidSpill of
false -> %% No new temps, we are done.
?add_spills(Options, _NewSpillIndex),
@@ -66,10 +65,9 @@ alloc(Defun, CFG, SpillLimit, SpillIndex, Options, RegAllocMod, TargetMod) ->
%% false ->
%% ok
%% end,
- {NewDefun, Coloring2, NewSpillIndex2};
+ {NewCFG, Coloring2, NewSpillIndex2};
_ ->
- NewCFG = TargetMod:defun_to_cfg(NewDefun),
%% Since SpillLimit is used as a low-water-mark
%% the list of temps not to spill is uninteresting.
- alloc(NewDefun, NewCFG, SpillLimit, SpillIndex, Options, RegAllocMod, TargetMod)
+ alloc(NewCFG, SpillLimit, SpillIndex, Options, RegAllocMod, TargetMod)
end.