aboutsummaryrefslogtreecommitdiffstats
path: root/lib/hipe/regalloc/hipe_coalescing_regalloc.erl
diff options
context:
space:
mode:
authorMagnus Lång <[email protected]>2017-03-23 22:03:03 +0100
committerMagnus Lång <[email protected]>2017-03-23 22:03:03 +0100
commit3cf6a85eb32e173b533de47bcd530364ceb20dc5 (patch)
treecaf9699746210fadffd36f5198344178892b942b /lib/hipe/regalloc/hipe_coalescing_regalloc.erl
parent84be7e0ec7c0c64f1beb418cdd09879822aca4b0 (diff)
downloadotp-3cf6a85eb32e173b533de47bcd530364ceb20dc5.tar.gz
otp-3cf6a85eb32e173b533de47bcd530364ceb20dc5.tar.bz2
otp-3cf6a85eb32e173b533de47bcd530364ceb20dc5.zip
HiPE: Fix off-by-one in register allocators
hipe_regalloc_loop considers SpillLimit to be an inclusive lower bound, the allocators considered it to be an exclusive lower bound. The allocators are changed to also consider it an inclusive lower bound. This caused the register allocators to occasionally spill the first "unspillable" temporary. This caused a failure in a newly added assertion when hipe-compiling dets_v9 on x86.
Diffstat (limited to 'lib/hipe/regalloc/hipe_coalescing_regalloc.erl')
-rw-r--r--lib/hipe/regalloc/hipe_coalescing_regalloc.erl2
1 files changed, 1 insertions, 1 deletions
diff --git a/lib/hipe/regalloc/hipe_coalescing_regalloc.erl b/lib/hipe/regalloc/hipe_coalescing_regalloc.erl
index e8ccbec9f1..b8f0a1974c 100644
--- a/lib/hipe/regalloc/hipe_coalescing_regalloc.erl
+++ b/lib/hipe/regalloc/hipe_coalescing_regalloc.erl
@@ -914,7 +914,7 @@ findCheapest([Node|Nodes], IG, Cost, Cheapest, SpillLimit) ->
%% limit are extremely expensive.
getCost(Node, IG, SpillLimit) ->
- case Node > SpillLimit of
+ case Node >= SpillLimit of
true -> inf;
false -> hipe_ig:node_spill_cost(Node, IG)
end.