aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorBjörn Gustavsson <[email protected]>2017-12-19 10:11:59 +0100
committerBjörn Gustavsson <[email protected]>2017-12-20 10:25:15 +0100
commitcada4236a5c952cfcccf6dafe6f9ac25d171529e (patch)
tree6dbed686950c89140fa758faf5b458ecd870b1e3
parentd0e24bb70eafd5b1e61b1af5f703bf9343075b53 (diff)
downloadotp-cada4236a5c952cfcccf6dafe6f9ac25d171529e.tar.gz
otp-cada4236a5c952cfcccf6dafe6f9ac25d171529e.tar.bz2
otp-cada4236a5c952cfcccf6dafe6f9ac25d171529e.zip
Reduce register shuffling in receive clauses
Handle a few more instructions in beam_utils. That will allow beam_reorder to reorder more instructions, delaying get_tuple_element instructions and reducing register shuffling in receive clauses.
-rw-r--r--lib/compiler/src/beam_utils.erl4
1 files changed, 4 insertions, 0 deletions
diff --git a/lib/compiler/src/beam_utils.erl b/lib/compiler/src/beam_utils.erl
index e61d6a43b4..60221578bd 100644
--- a/lib/compiler/src/beam_utils.erl
+++ b/lib/compiler/src/beam_utils.erl
@@ -593,6 +593,10 @@ check_liveness(R, [{allocate_zero,N,Live}|Is], St) ->
check_liveness(R, [{get_list,S,D1,D2}|Is], St) ->
I = {block,[{set,[D1,D2],[S],get_list}]},
check_liveness(R, [I|Is], St);
+check_liveness(R, [remove_message|Is], St) ->
+ check_liveness(R, Is, St);
+check_liveness({x,X}, [build_stacktrace|_], St) when X > 0 ->
+ {killed,St};
check_liveness(_R, Is, St) when is_list(Is) ->
%% Not implemented. Conservatively assume that the register is used.
{used,St}.