diff options
author | Björn Gustavsson <[email protected]> | 2019-01-12 10:40:30 +0100 |
---|---|---|
committer | Björn Gustavsson <[email protected]> | 2019-01-16 13:06:00 +0100 |
commit | c865abfcd396957e3c831a9f3dbe7922f63795be (patch) | |
tree | 53d6b3afee23f3a9c061b2134d45ddec88c557b4 /lib/compiler/src/beam_bs.erl | |
parent | 401bd13ffd39052d4125fbc6fc8360dc08121883 (diff) | |
download | otp-c865abfcd396957e3c831a9f3dbe7922f63795be.tar.gz otp-c865abfcd396957e3c831a9f3dbe7922f63795be.tar.bz2 otp-c865abfcd396957e3c831a9f3dbe7922f63795be.zip |
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).
Diffstat (limited to 'lib/compiler/src/beam_bs.erl')
-rw-r--r-- | lib/compiler/src/beam_bs.erl | 9 |
1 files changed, 0 insertions, 9 deletions
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([]) -> []. |