diff options
author | Sverker Eriksson <[email protected]> | 2017-03-27 16:50:29 +0200 |
---|---|---|
committer | GitHub <[email protected]> | 2017-03-27 16:50:29 +0200 |
commit | 236f2cecd0b0d8116c000187780f3981e6e9b388 (patch) | |
tree | 1af61e549d3453f07381d313d52bd268a817f276 /lib/hipe/regalloc/hipe_graph_coloring_regalloc.erl | |
parent | be2b0e6e5b4786cb6f7d56cdcdc05339aa214406 (diff) | |
parent | 3cf6a85eb32e173b533de47bcd530364ceb20dc5 (diff) | |
download | otp-236f2cecd0b0d8116c000187780f3981e6e9b388.tar.gz otp-236f2cecd0b0d8116c000187780f3981e6e9b388.tar.bz2 otp-236f2cecd0b0d8116c000187780f3981e6e9b388.zip |
Merge pull request #1387 from margnus1/hipe-spilllimit-fix
HiPE: Fix off-by-one bug in register allocators
Fix for PR-1380
Diffstat (limited to 'lib/hipe/regalloc/hipe_graph_coloring_regalloc.erl')
-rw-r--r-- | lib/hipe/regalloc/hipe_graph_coloring_regalloc.erl | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/lib/hipe/regalloc/hipe_graph_coloring_regalloc.erl b/lib/hipe/regalloc/hipe_graph_coloring_regalloc.erl index 07aa812f4a..f82d3a2cbc 100644 --- a/lib/hipe/regalloc/hipe_graph_coloring_regalloc.erl +++ b/lib/hipe/regalloc/hipe_graph_coloring_regalloc.erl @@ -209,8 +209,8 @@ color(IG, Spill, PhysRegs, SpillIx, SpillLimit, NumNodes, Target, %% Any nodes above the spillimit must be colored first... MustNotSpill = - if NumNodes > SpillLimit+1 -> - sort_on_degree(lists:seq(SpillLimit+1,NumNodes-1) -- Low,IG); + if NumNodes > SpillLimit -> + sort_on_degree(lists:seq(SpillLimit,NumNodes-1) -- Low,IG); true -> [] end, @@ -401,7 +401,7 @@ spill_costs([{N,Info}|Ns], IG, Vis, Spill, SpillLimit, Target) -> true -> spill_costs(Ns, IG, Vis, Spill, SpillLimit, Target); false -> - if N > SpillLimit -> + if N >= SpillLimit -> spill_costs(Ns, IG, Vis, Spill, SpillLimit, Target); true -> [{spill_cost_of(N,Spill)/Deg,N} | |