diff options
author | Magnus Lång <[email protected]> | 2016-03-17 21:48:55 +0100 |
---|---|---|
committer | Magnus Lång <[email protected]> | 2016-08-30 17:17:59 +0200 |
commit | c7a0cd1b5710178878d9b240f634e9eda7e68d96 (patch) | |
tree | b287178ec0495d089857287df7e78b1ca119422c /lib/hipe/opt/hipe_spillmin.erl | |
parent | dc4e9384c6f2f733ab0d12727ab53238bda3fbca (diff) | |
download | otp-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/opt/hipe_spillmin.erl')
-rw-r--r-- | lib/hipe/opt/hipe_spillmin.erl | 16 |
1 files changed, 12 insertions, 4 deletions
diff --git a/lib/hipe/opt/hipe_spillmin.erl b/lib/hipe/opt/hipe_spillmin.erl index 4eeb1d71db..6bb6980ad5 100644 --- a/lib/hipe/opt/hipe_spillmin.erl +++ b/lib/hipe/opt/hipe_spillmin.erl @@ -49,7 +49,7 @@ %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -module(hipe_spillmin). --export([stackalloc/6, mapmerge/2]). +-export([stackalloc/6, stackalloc/7, mapmerge/2]). %%-define(DEBUG, 1). -define(HIPE_INSTRUMENT_COMPILER, true). @@ -69,16 +69,24 @@ -spec stackalloc(#cfg{}, [_], non_neg_integer(), comp_options(), module(), hipe_temp_map()) -> - {hipe_spill_map(), non_neg_integer()}. + {hipe_spill_map(), non_neg_integer()}. stackalloc(CFG, StackSlots, SpillIndex, Options, Target, TempMap) -> + Liveness = Target:analyze(CFG), + stackalloc(CFG, Liveness, StackSlots, SpillIndex, Options, Target, TempMap). + +-spec stackalloc(#cfg{}, _, [_], non_neg_integer(), + comp_options(), module(), hipe_temp_map()) -> + {hipe_spill_map(), non_neg_integer()}. + +stackalloc(CFG, Liveness, StackSlots, SpillIndex, Options, Target, TempMap) -> case proplists:get_bool(spillmin_color, Options) of false -> - ?option_time(hipe_spillmin_scan:stackalloc(CFG, StackSlots, SpillIndex, + ?option_time(hipe_spillmin_scan:stackalloc(CFG, Liveness, StackSlots, SpillIndex, Options, Target, TempMap), "Spill minimize, linear scan", Options); true -> - ?option_time(hipe_spillmin_color:stackalloc(CFG, StackSlots, SpillIndex, + ?option_time(hipe_spillmin_color:stackalloc(CFG, Liveness, StackSlots, SpillIndex, Options, Target, TempMap), "Spill minimize, graph coloring", Options) end. |