diff options
author | Björn Gustavsson <[email protected]> | 2017-10-23 12:40:47 +0200 |
---|---|---|
committer | Björn Gustavsson <[email protected]> | 2017-10-23 12:40:47 +0200 |
commit | db67b2c3d1198b2093cb9add3aa55c59bb368ab5 (patch) | |
tree | a5dc718fae196ff613f828c0f283327db6952d95 /erts/emulator | |
parent | e7e17c75b38392f6722a00df45581b104e2829e2 (diff) | |
parent | 19a1af93458ec7a4a252671603d74971f4dec969 (diff) | |
download | otp-db67b2c3d1198b2093cb9add3aa55c59bb368ab5.tar.gz otp-db67b2c3d1198b2093cb9add3aa55c59bb368ab5.tar.bz2 otp-db67b2c3d1198b2093cb9add3aa55c59bb368ab5.zip |
Merge branch 'bjorn/compiler/match-literals'
* bjorn/compiler/match-literals:
Optimize instructions for comparing a register with a literal
Optimize matching of literals for single-valued types
Diffstat (limited to 'erts/emulator')
-rw-r--r-- | erts/emulator/beam/instrs.tab | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/erts/emulator/beam/instrs.tab b/erts/emulator/beam/instrs.tab index 20d356a81d..c17d1a8f69 100644 --- a/erts/emulator/beam/instrs.tab +++ b/erts/emulator/beam/instrs.tab @@ -788,7 +788,8 @@ is_eq_exact(Fail, X, Y) { } i_is_eq_exact_literal(Fail, Src, Literal) { - if (!eq($Src, $Literal)) { + Eterm src = $Src; + if (is_immed(src) || !eq(src, $Literal)) { $FAIL($Fail); } } @@ -800,7 +801,8 @@ is_ne_exact(Fail, X, Y) { } i_is_ne_exact_literal(Fail, Src, Literal) { - if (eq($Src, $Literal)) { + Eterm src = $Src; + if (!is_immed(src) && eq(src, $Literal)) { $FAIL($Fail); } } |