aboutsummaryrefslogtreecommitdiffstats
path: root/erts
diff options
context:
space:
mode:
authorJohn Högberg <[email protected]>2019-06-11 08:15:07 +0200
committerJohn Högberg <[email protected]>2019-06-11 08:15:07 +0200
commit50c9a2e0f0668bcdc0d2779d450d28bdd8c8926c (patch)
tree2b0d29afea4f27c19d0ef9cacea8e7182360d15e /erts
parent05d316d93ddb4796b03a4a04175fd8c09b0092be (diff)
parent5ee02a07b5c31aea4dd464060fa626d6e6ab8ceb (diff)
downloadotp-50c9a2e0f0668bcdc0d2779d450d28bdd8c8926c.tar.gz
otp-50c9a2e0f0668bcdc0d2779d450d28bdd8c8926c.tar.bz2
otp-50c9a2e0f0668bcdc0d2779d450d28bdd8c8926c.zip
Merge branch 'john/erts/fix-bad-get_tuple_element-opt/OTP-15871/ERIERL-374' into maint
* john/erts/fix-bad-get_tuple_element-opt/OTP-15871/ERIERL-374: erts: Fix bad loader optimization of get_tuple_element
Diffstat (limited to 'erts')
-rw-r--r--erts/emulator/beam/ops.tab19
1 files changed, 12 insertions, 7 deletions
diff --git a/erts/emulator/beam/ops.tab b/erts/emulator/beam/ops.tab
index 10ca74cd60..e9107933f9 100644
--- a/erts/emulator/beam/ops.tab
+++ b/erts/emulator/beam/ops.tab
@@ -1,7 +1,7 @@
#
# %CopyrightBegin%
#
-# Copyright Ericsson AB 1997-2018. All Rights Reserved.
+# Copyright Ericsson AB 1997-2019. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
@@ -699,13 +699,18 @@ is_tuple NotTupleFail Tuple=x | is_tagged_tuple WrongRecordFail Tuple Arity Atom
is_tagged_tuple_ff f? f? rx A a
-get_tuple_element Reg=x P1 D1=x | get_tuple_element Reg=x P2 D2=x | \
+get_tuple_element Reg=x P1 D1=x | \
+ get_tuple_element Reg=x P2 D2=x | \
get_tuple_element Reg=x P3 D3=x | \
- succ(P1, P2) | succ(P2, P3) | \
- succ(D1, D2) | succ(D2, D3) => i_get_tuple_element3 Reg P1 D1
-
-get_tuple_element Reg=x P1 D1=x | get_tuple_element Reg=x P2 D2=x | \
- succ(P1, P2) | succ(D1, D2) => i_get_tuple_element2 Reg P1 D1
+ succ(P1, P2) | succ(P2, P3) | succ(D1, D2) | succ(D2, D3) | \
+ distinct(D1, Reg) | distinct(D2, Reg) | distinct(D3, Reg) => \
+ i_get_tuple_element3 Reg P1 D1
+
+get_tuple_element Reg=x P1 D1=x | \
+ get_tuple_element Reg=x P2 D2=x | \
+ succ(P1, P2) | succ(D1, D2) | \
+ distinct(D1, Reg) => \
+ i_get_tuple_element2 Reg P1 D1
get_tuple_element Reg=x P1 D1=x | get_tuple_element Reg=x P2 D2=x | \
succ(P1, P2) | distinct(D1, Reg) => i_get_tuple_element2_dst Reg P1 D1 D2