aboutsummaryrefslogtreecommitdiffstats
path: root/lib/hipe/regalloc/hipe_regalloc_loop.erl
diff options
context:
space:
mode:
authorMagnus Lång <[email protected]>2016-06-20 18:57:00 +0200
committerMagnus Lång <[email protected]>2016-09-02 15:59:17 +0200
commit0ef50d2e3ca058e94676f9ec48de805f216c6c9e (patch)
tree53de0b4262804791e608d8ccd94b66b4f609ff15 /lib/hipe/regalloc/hipe_regalloc_loop.erl
parent52964d9fbc8031298c977d5e4a9ef7b5605875ae (diff)
downloadotp-0ef50d2e3ca058e94676f9ec48de805f216c6c9e.tar.gz
otp-0ef50d2e3ca058e94676f9ec48de805f216c6c9e.tar.bz2
otp-0ef50d2e3ca058e94676f9ec48de805f216c6c9e.zip
hipe_regalloc_prepass: Rename coloring collisions
Diffstat (limited to 'lib/hipe/regalloc/hipe_regalloc_loop.erl')
-rw-r--r--lib/hipe/regalloc/hipe_regalloc_loop.erl14
1 files changed, 10 insertions, 4 deletions
diff --git a/lib/hipe/regalloc/hipe_regalloc_loop.erl b/lib/hipe/regalloc/hipe_regalloc_loop.erl
index 34662200e5..8d564c35ae 100644
--- a/lib/hipe/regalloc/hipe_regalloc_loop.erl
+++ b/lib/hipe/regalloc/hipe_regalloc_loop.erl
@@ -39,21 +39,24 @@ ra_common(CFG, SpillIndex, Options, RegAllocMod, TargetMod) ->
SpillLimit = TargetMod:number_of_temporaries(CFG),
alloc(CFG, SpillLimit, SpillIndex, Options, RegAllocMod, TargetMod).
-alloc(CFG, SpillLimit, SpillIndex, Options, RegAllocMod, TargetMod) ->
+alloc(CFG0, SpillLimit, SpillIndex, Options, RegAllocMod, TargetMod) ->
?inc_counter(ra_iteration_counter, 1),
- {Coloring, _NewSpillIndex, Liveness} =
+ {Coloring, _NewSpillIndex, CFG, MaybeLiveness} =
case proplists:get_bool(ra_prespill, Options) of
true ->
hipe_regalloc_prepass:regalloc(
- RegAllocMod, CFG, SpillIndex, SpillLimit, TargetMod, Options);
+ RegAllocMod, CFG0, SpillIndex, SpillLimit, TargetMod, Options);
false ->
- RegAllocMod:regalloc(CFG, SpillIndex, SpillLimit, TargetMod, Options)
+ {C, SI, L} = RegAllocMod:regalloc(CFG0, SpillIndex, SpillLimit,
+ TargetMod, Options),
+ {C, SI, CFG0, L}
end,
{NewCFG, DidSpill} = TargetMod:check_and_rewrite(CFG, Coloring),
case DidSpill of
false -> %% No new temps, we are done.
?add_spills(Options, _NewSpillIndex),
TempMap = hipe_temp_map:cols2tuple(Coloring, TargetMod),
+ Liveness = liveness_force(TargetMod, CFG, MaybeLiveness),
{TempMap2, NewSpillIndex2} =
hipe_spillmin:stackalloc(CFG, Liveness, [], SpillIndex, Options,
TargetMod, TempMap),
@@ -71,3 +74,6 @@ alloc(CFG, SpillLimit, SpillIndex, Options, RegAllocMod, TargetMod) ->
%% the list of temps not to spill is uninteresting.
alloc(NewCFG, SpillLimit, SpillIndex, Options, RegAllocMod, TargetMod)
end.
+
+liveness_force(TargetMod, CFG, undefined) -> TargetMod:analyze(CFG);
+liveness_force(_TargetMod, _CFG, Defined) -> Defined.