diff options
author | Björn Gustavsson <[email protected]> | 2016-04-07 12:43:06 +0200 |
---|---|---|
committer | Björn Gustavsson <[email protected]> | 2016-04-08 10:28:42 +0200 |
commit | ab03678e87732407625150c202e177a85a025beb (patch) | |
tree | 881f543c0f7ca0cb099fe3eec71a7b37b0bf27be /lib/compiler/src/beam_split.erl | |
parent | 3c0f98c1b0e74eb58a4e4e82a3ec89dc7ecdb579 (diff) | |
download | otp-ab03678e87732407625150c202e177a85a025beb.tar.gz otp-ab03678e87732407625150c202e177a85a025beb.tar.bz2 otp-ab03678e87732407625150c202e177a85a025beb.zip |
Remove unreachable code after 'raise' instructions
Remove the unreachable instructions after a 'raise' instruction
(e.g. a 'jump' or 'deallocate', 'return') to decrease code size.
Diffstat (limited to 'lib/compiler/src/beam_split.erl')
-rw-r--r-- | lib/compiler/src/beam_split.erl | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/lib/compiler/src/beam_split.erl b/lib/compiler/src/beam_split.erl index bb1c0e23a9..7b7f0a0f80 100644 --- a/lib/compiler/src/beam_split.erl +++ b/lib/compiler/src/beam_split.erl @@ -47,6 +47,8 @@ split_block([{set,[R],[_,_,_]=As,{bif,is_record,{f,Lbl}}}|Is], Bl, Acc) -> split_block(Is, [], [{bif,is_record,{f,Lbl},As,R}|make_block(Bl, Acc)]); split_block([{set,[R],As,{bif,N,{f,Lbl}=Fail}}|Is], Bl, Acc) when Lbl =/= 0 -> split_block(Is, [], [{bif,N,Fail,As,R}|make_block(Bl, Acc)]); +split_block([{set,[R],As,{bif,raise,{f,_}=Fail}}|Is], Bl, Acc) -> + split_block(Is, [], [{bif,raise,Fail,As,R}|make_block(Bl, Acc)]); split_block([{set,[R],As,{alloc,Live,{gc_bif,N,{f,Lbl}=Fail}}}|Is], Bl, Acc) when Lbl =/= 0 -> split_block(Is, [], [{gc_bif,N,Fail,Live,As,R}|make_block(Bl, Acc)]); |