From c865abfcd396957e3c831a9f3dbe7922f63795be Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bj=C3=B6rn=20Gustavsson?= Date: Sat, 12 Jan 2019 10:40:30 +0100 Subject: Move coalescing of bs_skip to beam_ssa_opt The optimization can be applied in a few more places if done before ssa_opt_bsm_shortcut (for example, in unicode:cbv/2). --- lib/compiler/src/beam_bs.erl | 9 --------- 1 file changed, 9 deletions(-) (limited to 'lib/compiler/src/beam_bs.erl') diff --git a/lib/compiler/src/beam_bs.erl b/lib/compiler/src/beam_bs.erl index 15d8d687fc..eea0cfcd02 100644 --- a/lib/compiler/src/beam_bs.erl +++ b/lib/compiler/src/beam_bs.erl @@ -43,21 +43,12 @@ function({function,Name,Arity,CLabel,Is0}) -> %%% %%% Evaluate construction of constant bit fields. -%%% Combine bs_skip_bits2 and bs_test_tail2 instructions. %%% bs_opt([{bs_put,_,_,_}=I|Is0]) -> {BsPuts0,Is} = collect_bs_puts(Is0, [I]), BsPuts = opt_bs_puts(BsPuts0), BsPuts ++ bs_opt(Is); -bs_opt([{test,bs_skip_bits2,F,[Ctx,{integer,I},Unit,_Flags]}, - {test,bs_test_tail2,F,[Ctx,Bits]}|Is]) -> - [{test,bs_test_tail2,F,[Ctx,Bits+I*Unit]}|bs_opt(Is)]; -bs_opt([{test,bs_skip_bits2,F,[Ctx,{integer,I1},Unit1,Flags]}, - {test,bs_skip_bits2,F,[Ctx,{integer,I2},Unit2,_]}|Is]) -> - I = {test,bs_skip_bits2,F, - [Ctx,{integer,I1*Unit1+I2*Unit2},1,Flags]}, - bs_opt([I|Is]); bs_opt([I|Is]) -> [I|bs_opt(Is)]; bs_opt([]) -> []. -- cgit v1.2.3