diff options
author | Michał Muskała <[email protected]> | 2017-08-26 15:15:01 +0200 |
---|---|---|
committer | Michał Muskała <[email protected]> | 2017-09-08 01:49:10 +0200 |
commit | f9a323d10a9f5da305cbdec632d6bdf7ad4770b5 (patch) | |
tree | 7c71ba5bf06ea9b13f3846f05a767be19895399d /lib/compiler/test | |
parent | 5d124efc4f8408cdbe2f23ca6b233b932f1dd7c6 (diff) | |
download | otp-f9a323d10a9f5da305cbdec632d6bdf7ad4770b5.tar.gz otp-f9a323d10a9f5da305cbdec632d6bdf7ad4770b5.tar.bz2 otp-f9a323d10a9f5da305cbdec632d6bdf7ad4770b5.zip |
Optimise equality comparisons
* In both loader and compiler, make sure constants are always the second
operand - many passes of the compiler assume that's always the case.
* In loader rewrite is_eq_exact with same arguments to skip the instruction
and with different constants move one to an x register to maintain
the properly outlined above.
* The same (but in reverse) is done with the is_ne_exact, where we rewrite
to an unconditional jump or add a move to an x register.
* All of the above allow to replace is_eq_exact_fss with is_eq_exact_fyy and
is_ne_exact_fss with is_ne_exact_fSS as those are the only possibilities left.
Diffstat (limited to 'lib/compiler/test')
-rw-r--r-- | lib/compiler/test/guard_SUITE.erl | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/lib/compiler/test/guard_SUITE.erl b/lib/compiler/test/guard_SUITE.erl index ccb9b58225..d96cfdb7ac 100644 --- a/lib/compiler/test/guard_SUITE.erl +++ b/lib/compiler/test/guard_SUITE.erl @@ -1291,6 +1291,10 @@ rel_ops(Config) when is_list(Config) -> true = any_atom /= id(42), true = [] /= id(42), + %% Coverage of beam_utils:bif_to_test/3 + Empty = id([]), + ?T(==, [], Empty), + ok. -undef(TestOp). |