summaryrefslogtreecommitdiff
path: root/lib/compiler/src/beam_trim.erl
diff options
context:
space:
mode:
authorBjörn Gustavsson <bjorn@erlang.org>2012-08-31 19:14:10 +0200
committerBjörn Gustavsson <bjorn@erlang.org>2012-10-09 15:24:41 +0200
commited7ab81375d599c73cbe0d2195102187957c25d6 (patch)
treef2e4114919a1e79be55f6171997febf33c0b9f27 /lib/compiler/src/beam_trim.erl
parentb44f86b779f0b8579e4df2a98930ac3150c6c07c (diff)
downloaderlang-ed7ab81375d599c73cbe0d2195102187957c25d6.tar.gz
Rewrite bs_add, bs_utf*_size to BIF instructions in optimizations
We can remove some code bloat by handling the special instructions as BIF instructions in the optimization passes. Also note that bs_utf*_size was not handled by beam_utils:check_liveness/3 (meaning the conservative answer instead of the correct answer would be returned).
Diffstat (limited to 'lib/compiler/src/beam_trim.erl')
-rw-r--r--lib/compiler/src/beam_trim.erl5
1 files changed, 0 insertions, 5 deletions
diff --git a/lib/compiler/src/beam_trim.erl b/lib/compiler/src/beam_trim.erl
index 5856f0d3b5..8f694f602b 100644
--- a/lib/compiler/src/beam_trim.erl
+++ b/lib/compiler/src/beam_trim.erl
@@ -172,9 +172,6 @@ remap([{bif,Name,Fail,Ss,D}|Is], Map, Acc) ->
remap([{gc_bif,Name,Fail,Live,Ss,D}|Is], Map, Acc) ->
I = {gc_bif,Name,Fail,Live,[Map(S) || S <- Ss],Map(D)},
remap(Is, Map, [I|Acc]);
-remap([{bs_add,Fail,[SrcA,SrcB,U],D}|Is], Map, Acc) ->
- I = {bs_add,Fail,[Map(SrcA),Map(SrcB),U],Map(D)},
- remap(Is, Map, [I|Acc]);
remap([{bs_append=Op,Fail,Bits,Heap,Live,Unit,Bin,Flags,D}|Is], Map, Acc) ->
I = {Op,Fail,Map(Bits),Heap,Live,Unit,Map(Bin),Flags,Map(D)},
remap(Is, Map, [I|Acc]);
@@ -287,8 +284,6 @@ frame_size([{test,_,{f,L},_}|Is], Safe) ->
frame_size_branch(L, Is, Safe);
frame_size([{test,_,{f,L},_,_,_}|Is], Safe) ->
frame_size_branch(L, Is, Safe);
-frame_size([{bs_add,{f,L},_,_}|Is], Safe) ->
- frame_size_branch(L, Is, Safe);
frame_size([{bs_append,{f,L},_,_,_,_,_,_,_}|Is], Safe) ->
frame_size_branch(L, Is, Safe);
frame_size([{bs_private_append,{f,L},_,_,_,_,_}|Is], Safe) ->