diff options
author | Björn Gustavsson <[email protected]> | 2018-08-21 08:17:24 +0200 |
---|---|---|
committer | Björn Gustavsson <[email protected]> | 2018-09-12 14:19:04 +0200 |
commit | be092fb5fecfc382a45681d8de07fda27d77bf26 (patch) | |
tree | e25b4b4bec4ec57299b0a0684905ccf79e5289ab /lib/compiler/src/beam_ssa_type.erl | |
parent | d3551827cc0221437098c5afa492637072f8a771 (diff) | |
download | otp-be092fb5fecfc382a45681d8de07fda27d77bf26.tar.gz otp-be092fb5fecfc382a45681d8de07fda27d77bf26.tar.bz2 otp-be092fb5fecfc382a45681d8de07fda27d77bf26.zip |
Optimize 'and' and 'or' instructions
Diffstat (limited to 'lib/compiler/src/beam_ssa_type.erl')
-rw-r--r-- | lib/compiler/src/beam_ssa_type.erl | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/lib/compiler/src/beam_ssa_type.erl b/lib/compiler/src/beam_ssa_type.erl index ae926960bf..8ad520df63 100644 --- a/lib/compiler/src/beam_ssa_type.erl +++ b/lib/compiler/src/beam_ssa_type.erl @@ -449,6 +449,11 @@ type(succeeded, [#b_var{name=Src}], Ts, Ds) -> #b_set{op={bif,Bif},args=BifArgs} -> Types = get_types(BifArgs, Ts), case {Bif,Types} of + {BoolOp,[T1,T2]} when BoolOp =:= 'and'; BoolOp =:= 'or' -> + case t_is_boolean(T1) andalso t_is_boolean(T2) of + true -> t_atom(true); + false -> t_boolean() + end; {byte_size,[{binary,_}]} -> t_atom(true); {bit_size,[{binary,_}]} -> |