aboutsummaryrefslogtreecommitdiffstats
path: root/lib/compiler/src/beam_kernel_to_ssa.erl
diff options
context:
space:
mode:
authorJosé Valim <[email protected]>2019-03-01 05:18:34 -0800
committerJosé Valim <[email protected]>2019-03-01 05:19:55 -0800
commit1b706c511e9508c910296b255bdeb279e0957ff5 (patch)
treeef1695a4ae349e421207a785e86acf96f141123a /lib/compiler/src/beam_kernel_to_ssa.erl
parentcc12aeb0ce4a9444aba199f6d145ef525de268a9 (diff)
downloadotp-1b706c511e9508c910296b255bdeb279e0957ff5.tar.gz
otp-1b706c511e9508c910296b255bdeb279e0957ff5.tar.bz2
otp-1b706c511e9508c910296b255bdeb279e0957ff5.zip
Move size=all binary clause prunning to v3_kernel
The advantage of moving it up is that it reduces the size of the code emitted by v3_kernel, speeding v3_kernel itself and beam_kernel_to_ssa pass.
Diffstat (limited to 'lib/compiler/src/beam_kernel_to_ssa.erl')
-rw-r--r--lib/compiler/src/beam_kernel_to_ssa.erl10
1 files changed, 1 insertions, 9 deletions
diff --git a/lib/compiler/src/beam_kernel_to_ssa.erl b/lib/compiler/src/beam_kernel_to_ssa.erl
index 410bafe0bb..df95749fb3 100644
--- a/lib/compiler/src/beam_kernel_to_ssa.erl
+++ b/lib/compiler/src/beam_kernel_to_ssa.erl
@@ -327,7 +327,7 @@ select_bin_seg(#k_val_clause{val=#k_bin_seg{size=Size,unit=U,type=T,
{Mis,St1} = select_extract_bin(Next, Size, U, T, Fs, Fail,
Ctx, LineAnno, St0),
{Extracted,St2} = new_ssa_var(Seg#k_var.name, St1),
- {Bis,St} = bin_match_cg(Size, B, Fail, St2),
+ {Bis,St} = match_cg(B, Fail, St2),
BsGet = #b_set{op=bs_extract,dst=Extracted,args=[ssa_arg(Next, St)]},
Is = Mis ++ [BsGet] ++ Bis,
{Is,St};
@@ -362,14 +362,6 @@ select_bin_seg(#k_val_clause{val=#k_bin_int{size=Sz,unit=U,flags=Fs,
end,
{Is,St}.
-bin_match_cg(#k_atom{val=all}, B0, Fail, St) ->
- #k_select{types=Types} = B0,
- [#k_type_clause{type=k_bin_end,values=Values}] = Types,
- [#k_val_clause{val=#k_bin_end{},body=B}] = Values,
- match_cg(B, Fail, St);
-bin_match_cg(_, B, Fail, St) ->
- match_cg(B, Fail, St).
-
get_context(#k_var{}=Var, St) ->
ssa_arg(Var, St).