aboutsummaryrefslogtreecommitdiffstats
path: root/lib/hipe/regalloc/hipe_ls_regalloc.erl
diff options
context:
space:
mode:
authorMagnus Lång <[email protected]>2016-03-17 21:48:55 +0100
committerMagnus Lång <[email protected]>2016-08-30 17:17:59 +0200
commitc7a0cd1b5710178878d9b240f634e9eda7e68d96 (patch)
treeb287178ec0495d089857287df7e78b1ca119422c /lib/hipe/regalloc/hipe_ls_regalloc.erl
parentdc4e9384c6f2f733ab0d12727ab53238bda3fbca (diff)
downloadotp-c7a0cd1b5710178878d9b240f634e9eda7e68d96.tar.gz
otp-c7a0cd1b5710178878d9b240f634e9eda7e68d96.tar.bz2
otp-c7a0cd1b5710178878d9b240f634e9eda7e68d96.zip
hipe: Reuse liveness info for spillmin
For x86, additionally reuse liveness from float LSRA for the GP LSRA.
Diffstat (limited to 'lib/hipe/regalloc/hipe_ls_regalloc.erl')
-rw-r--r--lib/hipe/regalloc/hipe_ls_regalloc.erl20
1 files changed, 14 insertions, 6 deletions
diff --git a/lib/hipe/regalloc/hipe_ls_regalloc.erl b/lib/hipe/regalloc/hipe_ls_regalloc.erl
index d24b803524..c318927077 100644
--- a/lib/hipe/regalloc/hipe_ls_regalloc.erl
+++ b/lib/hipe/regalloc/hipe_ls_regalloc.erl
@@ -56,7 +56,7 @@
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
-module(hipe_ls_regalloc).
--export([regalloc/7]).
+-export([regalloc/7, regalloc/8]).
%%-define(DEBUG,1).
-define(HIPE_INSTRUMENT_COMPILER, true).
@@ -96,10 +96,18 @@
%% @end
%%- - - - - - - - - - - - - - - - - - - - - - - -
regalloc(CFG, PhysRegs, Entrypoints, SpillIndex, DontSpill, Options, Target) ->
+ regalloc(CFG, undefined, PhysRegs, Entrypoints, SpillIndex, DontSpill, Options, Target).
+
+regalloc(CFG, Liveness0, PhysRegs, Entrypoints, SpillIndex, DontSpill, Options, Target) ->
?debug_msg("LinearScan: ~w\n", [erlang:statistics(runtime)]),
%% Step 1: Calculate liveness (Call external implementation.)
- Liveness = liveness(CFG, Target),
- ?debug_msg("liveness (done)~w\n", [erlang:statistics(runtime)]),
+ Liveness = case Liveness0 of
+ undefined ->
+ L=liveness(CFG, Target),
+ ?debug_msg("liveness (done)~w\n", [erlang:statistics(runtime)]),
+ L;
+ _ -> Liveness0
+ end,
USIntervals = calculate_intervals(CFG, Liveness,
Entrypoints, Options, Target),
?debug_msg("intervals (done) ~w\n", [erlang:statistics(runtime)]),
@@ -108,10 +116,10 @@ regalloc(CFG, PhysRegs, Entrypoints, SpillIndex, DontSpill, Options, Target) ->
%% ?debug_msg("Intervals ~w\n", [Intervals]),
?debug_msg("No intervals: ~w\n",[length(Intervals)]),
?debug_msg("count intervals (done) ~w\n", [erlang:statistics(runtime)]),
- Allocation = allocate(Intervals, PhysRegs, SpillIndex, DontSpill, Target),
+ {Coloring, NewSpillIndex}
+ = allocate(Intervals, PhysRegs, SpillIndex, DontSpill, Target),
?debug_msg("allocation (done) ~w\n", [erlang:statistics(runtime)]),
- Allocation.
-
+ {Coloring, NewSpillIndex, Liveness}.
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%% %%