aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorBjörn Gustavsson <[email protected]>2018-09-20 08:05:45 +0200
committerBjörn Gustavsson <[email protected]>2018-09-26 12:19:56 +0200
commitcd1357467759401fbc87d6b39045adbcaf5016d1 (patch)
treecaa3338fcdbb4945a3acb354db068ec919250535
parentaf632b4a9f259f5b8779d23d7aea6ebab7196724 (diff)
downloadotp-cd1357467759401fbc87d6b39045adbcaf5016d1.tar.gz
otp-cd1357467759401fbc87d6b39045adbcaf5016d1.tar.bz2
otp-cd1357467759401fbc87d6b39045adbcaf5016d1.zip
Remove the last optimization from beam_flatten
It is not necessary to combine get_hd and get_tl instruction to a get_list instruction. It will be done in beam_z. After this change, beam_flatten does nothing more than eliminating the blocks.
-rw-r--r--lib/compiler/src/beam_flatten.erl6
1 files changed, 2 insertions, 4 deletions
diff --git a/lib/compiler/src/beam_flatten.erl b/lib/compiler/src/beam_flatten.erl
index 07c24abf7b..3e6bc1b1ed 100644
--- a/lib/compiler/src/beam_flatten.erl
+++ b/lib/compiler/src/beam_flatten.erl
@@ -44,10 +44,8 @@ block([], Acc) -> reverse(Acc).
norm_block([{set,[],[],{alloc,R,Alloc}}|Is], Acc0) ->
norm_block(Is, reverse(norm_allocate(Alloc, R), Acc0));
-norm_block([{set,[D1],[S],get_hd},{set,[D2],[S],get_tl}|Is], Acc) ->
- I = {get_list,S,D1,D2},
- norm_block(Is, [I|Acc]);
-norm_block([I|Is], Acc) -> norm_block(Is, [norm(I)|Acc]);
+norm_block([I|Is], Acc) ->
+ norm_block(Is, [norm(I)|Acc]);
norm_block([], Acc) -> Acc.
norm({set,[D],As,{bif,N,F}}) -> {bif,N,F,As,D};