summaryrefslogtreecommitdiffstats
path: root/Python/tier2_redundancy_eliminator_bytecodes.c
diff options
context:
space:
mode:
authorKen Jin <kenjin@python.org>2024-02-20 11:30:49 (GMT)
committerGitHub <noreply@github.com>2024-02-20 11:30:49 (GMT)
commitdcba21f905ef170b2cd0a6433b6fe6bcb4316a67 (patch)
tree8b883ade9f3d2778b742545073dc9d959d594ff5 /Python/tier2_redundancy_eliminator_bytecodes.c
parenta2bb8ad14409c7ecb8dea437b0e281eb1f65b5d8 (diff)
downloadcpython-dcba21f905ef170b2cd0a6433b6fe6bcb4316a67.zip
cpython-dcba21f905ef170b2cd0a6433b6fe6bcb4316a67.tar.gz
cpython-dcba21f905ef170b2cd0a6433b6fe6bcb4316a67.tar.bz2
gh-115687: Split up guards from COMPARE_OP (GH-115688)
Diffstat (limited to 'Python/tier2_redundancy_eliminator_bytecodes.c')
-rw-r--r--Python/tier2_redundancy_eliminator_bytecodes.c8
1 files changed, 8 insertions, 0 deletions
diff --git a/Python/tier2_redundancy_eliminator_bytecodes.c b/Python/tier2_redundancy_eliminator_bytecodes.c
index 3f6e8ce..e9b556d 100644
--- a/Python/tier2_redundancy_eliminator_bytecodes.c
+++ b/Python/tier2_redundancy_eliminator_bytecodes.c
@@ -77,6 +77,14 @@ dummy_func(void) {
sym_set_type(right, &PyFloat_Type);
}
+ op(_GUARD_BOTH_UNICODE, (left, right -- left, right)) {
+ if (sym_matches_type(left, &PyUnicode_Type) &&
+ sym_matches_type(right, &PyUnicode_Type)) {
+ REPLACE_OP(this_instr, _NOP, 0 ,0);
+ }
+ sym_set_type(left, &PyUnicode_Type);
+ sym_set_type(right, &PyUnicode_Type);
+ }
op(_BINARY_OP_ADD_INT, (left, right -- res)) {
if (is_const(left) && is_const(right)) {