aboutsummaryrefslogtreecommitdiffstats
path: root/lib/compiler/src/beam_trim.erl
diff options
context:
space:
mode:
authorBjörn Gustavsson <[email protected]>2016-05-23 20:13:48 +0200
committerBjörn Gustavsson <[email protected]>2016-09-21 14:07:53 +0200
commit01835845579e9f0a8da3574864747cd3ba10db6e (patch)
tree024bddef605721cc1c22a1827ceb0fdb8df93525 /lib/compiler/src/beam_trim.erl
parent97820c026969de7e98d948b301da1e6956f0504d (diff)
downloadotp-01835845579e9f0a8da3574864747cd3ba10db6e.tar.gz
otp-01835845579e9f0a8da3574864747cd3ba10db6e.tar.bz2
otp-01835845579e9f0a8da3574864747cd3ba10db6e.zip
Simplify beam_utils
When beam_utils was first written, it did not have the functions for testing whether a register was not used. Those were added later, in sort of a hacky way. Also, is_killed*() and is_not_used*() for Y registers would return the same answer. Fix that to make the API more consistent (an Y register can only be killed by a deallocate/1 instruction). We will need to change beam_trim to call beam_utils:is_not_used/3 instead of beam_utils:is_killed/3.
Diffstat (limited to 'lib/compiler/src/beam_trim.erl')
-rw-r--r--lib/compiler/src/beam_trim.erl2
1 files changed, 1 insertions, 1 deletions
diff --git a/lib/compiler/src/beam_trim.erl b/lib/compiler/src/beam_trim.erl
index a8dc6805bc..d40669083e 100644
--- a/lib/compiler/src/beam_trim.erl
+++ b/lib/compiler/src/beam_trim.erl
@@ -230,7 +230,7 @@ safe_labels([], Acc) -> gb_sets:from_list(Acc).
frame_layout(Is, Kills, #st{safe=Safe,lbl=D}) ->
N = frame_size(Is, Safe),
- IsKilled = fun(R) -> beam_utils:is_killed(R, Is, D) end,
+ IsKilled = fun(R) -> beam_utils:is_not_used(R, Is, D) end,
{N,frame_layout_1(Kills, 0, N, IsKilled, [])}.
frame_layout_1([{kill,{y,Y}}=I|Ks], Y, N, IsKilled, Acc) ->