summaryrefslogtreecommitdiffstats
path: root/Python
diff options
context:
space:
mode:
authorINADA Naoki <methane@users.noreply.github.com>2017-12-14 13:18:26 (GMT)
committerGitHub <noreply@github.com>2017-12-14 13:18:26 (GMT)
commiteadad1b97f64619bfd246b9d3b60d25f456e0592 (patch)
tree36a99ea393b12c0ab753ed29d412fc6fdf7d73d2 /Python
parent374c6e178a7599aae46c857b17c6c8bc19dfe4c2 (diff)
downloadcpython-eadad1b97f64619bfd246b9d3b60d25f456e0592.zip
cpython-eadad1b97f64619bfd246b9d3b60d25f456e0592.tar.gz
cpython-eadad1b97f64619bfd246b9d3b60d25f456e0592.tar.bz2
bpo-29469: Remove unnecessary peephole optimizer (GH-4863)
Conversions like `not a is b -> a is not b` are implemented in AST optimizer in previous commit (7ea143a). So this commit removes them from peephole optimizer.
Diffstat (limited to 'Python')
-rw-r--r--Python/peephole.c15
1 files changed, 0 insertions, 15 deletions
diff --git a/Python/peephole.c b/Python/peephole.c
index 3c5290f..5817146 100644
--- a/Python/peephole.c
+++ b/Python/peephole.c
@@ -345,21 +345,6 @@ PyCode_Optimize(PyObject *code, PyObject* consts, PyObject *names,
in_consts = 0;
switch (opcode) {
- /* not a is b --> a is not b
- not a in b --> a not in b
- not a is not b --> a is b
- not a not in b --> a in b
- */
- case COMPARE_OP:
- j = get_arg(codestr, i);
- if (j < 6 || j > 9 ||
- nextop != UNARY_NOT ||
- !ISBASICBLOCK(blocks, op_start, i + 1))
- break;
- codestr[i] = PACKOPARG(opcode, j^1);
- fill_nops(codestr, i + 1, nexti + 1);
- break;
-
/* Skip over LOAD_CONST trueconst
POP_JUMP_IF_FALSE xx. This improves
"while 1" performance. */