aboutsummaryrefslogtreecommitdiffstats
path: root/lib/hipe/regalloc/hipe_coalescing_regalloc.erl
diff options
context:
space:
mode:
authorMagnus Lång <[email protected]>2016-09-01 17:21:25 +0200
committerMagnus Lång <[email protected]>2016-09-05 19:16:26 +0200
commit1039c0196a7e643c63ce71b2c6daa2b78b3aa832 (patch)
tree7540338826d46f9850278b3af8ad84e2f4c76119 /lib/hipe/regalloc/hipe_coalescing_regalloc.erl
parentb4695b8088b8fc6f3844e33246849ed8bb8b18cf (diff)
downloadotp-1039c0196a7e643c63ce71b2c6daa2b78b3aa832.tar.gz
otp-1039c0196a7e643c63ce71b2c6daa2b78b3aa832.tar.bz2
otp-1039c0196a7e643c63ce71b2c6daa2b78b3aa832.zip
hipe: Reuse liveness between regalloc iterations
This is sound because the liveness data structure only stores liveness info at basic block boundaries, and the rewrites that happen in TargetSpecific:check_and_rewrite/2 preserves all existing definitions and uses, and all new liveness intervals, belonging to newly introduced temporaries, are always local to a basic block, and thus do not show up in the liveout or livein sets for the basic block.
Diffstat (limited to 'lib/hipe/regalloc/hipe_coalescing_regalloc.erl')
-rw-r--r--lib/hipe/regalloc/hipe_coalescing_regalloc.erl7
1 files changed, 3 insertions, 4 deletions
diff --git a/lib/hipe/regalloc/hipe_coalescing_regalloc.erl b/lib/hipe/regalloc/hipe_coalescing_regalloc.erl
index bbb2e3ecf0..5f4bd4e524 100644
--- a/lib/hipe/regalloc/hipe_coalescing_regalloc.erl
+++ b/lib/hipe/regalloc/hipe_coalescing_regalloc.erl
@@ -30,7 +30,7 @@
%%-----------------------------------------------------------------------
-module(hipe_coalescing_regalloc).
--export([regalloc/5]).
+-export([regalloc/6]).
%%-ifndef(DEBUG).
%%-define(DEBUG,true).
@@ -54,10 +54,9 @@
%% SpillIndex2 -- A new spill index
%%-----------------------------------------------------------------------
-regalloc(CFG, SpillIndex, SpillLimit, Target, _Options) ->
+regalloc(CFG, Liveness, SpillIndex, SpillLimit, Target, _Options) ->
%% Build interference graph
?debug_msg("Build IG\n", []),
- Liveness = Target:analyze(CFG),
IG = hipe_ig:build(CFG, Liveness, Target),
%% io:format("IG: ~p\n", [IG]),
@@ -98,7 +97,7 @@ regalloc(CFG, SpillIndex, SpillLimit, Target, _Options) ->
{Coloring, SpillIndex2} =
build_namelist(Node_sets2, SpillIndex, Alias0, Color1),
?debug_msg("Coloring ~p\n", [Coloring]),
- {Coloring, SpillIndex2, Liveness}.
+ {Coloring, SpillIndex2}.
%%----------------------------------------------------------------------
%% Function: do_coloring