diff options
author | Björn Gustavsson <bjorn@erlang.org> | 2022-01-31 05:19:08 +0100 |
---|---|---|
committer | Björn Gustavsson <bjorn@erlang.org> | 2022-01-31 14:15:27 +0100 |
commit | e818258f84fbecf232797df5d71ee46e23a43391 (patch) | |
tree | de45b36b406dc5915bb899c6c2b59dfe55c1beed /lib/compiler/src/beam_validator.erl | |
parent | 8320b5a44d332e34866fa50ffb09dc15253ff8a1 (diff) | |
download | erlang-e818258f84fbecf232797df5d71ee46e23a43391.tar.gz |
beam_call_types: Infer the type for `band` more aggressively
For expressions such as:
Unknown band 42
the type would conservatively be assumed to be any integer.
Be less conservative and assume that the type is an integer
in the range 0 .. 42. That will give more opportunities for
the JIT to eliminate type tests.
Note that for:
Unknown band 0
we will still infer the type to be any integer instead of the integer
0. The reason is that code such as:
foo(Unknown) ->
Unknown band 0.
would be rewritten to:
foo(Unknown) ->
Unknown band 0,
0.
if we were to assume that `Unknown band 0` is 0. This is a
pessimization.
Diffstat (limited to 'lib/compiler/src/beam_validator.erl')
0 files changed, 0 insertions, 0 deletions