aboutsummaryrefslogtreecommitdiffstats
path: root/erts/emulator
diff options
context:
space:
mode:
authorBjörn Gustavsson <[email protected]>2017-10-23 12:40:47 +0200
committerBjörn Gustavsson <[email protected]>2017-10-23 12:40:47 +0200
commitdb67b2c3d1198b2093cb9add3aa55c59bb368ab5 (patch)
treea5dc718fae196ff613f828c0f283327db6952d95 /erts/emulator
parente7e17c75b38392f6722a00df45581b104e2829e2 (diff)
parent19a1af93458ec7a4a252671603d74971f4dec969 (diff)
downloadotp-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.tab6
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);
}
}