[issue17607] missed peephole optimization (unnecessary jump at end of function after yield)

2018-01-05 Thread Serhiy Storchaka

Serhiy Storchaka  added the comment:

This optimization already is implemented in 3.5+. Actually it is implemented as 
a part of code generation, not a peepholer.

--
nosy: +serhiy.storchaka
resolution:  -> out of date
stage:  -> resolved
status: open -> closed

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue17607] missed peephole optimization (unnecessary jump at end of function after yield)

2013-04-10 Thread Ezio Melotti

Changes by Ezio Melotti ezio.melo...@gmail.com:


--
nosy: +ezio.melotti
versions: +Python 3.4 -Python 2.7

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue17607
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue17607] missed peephole optimization (unnecessary jump at end of function after yield)

2013-04-02 Thread STINNER Victor

STINNER Victor added the comment:

This issue is similar to #17430.

--
nosy: +haypo

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue17607
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue17607] missed peephole optimization (unnecessary jump at end of function after yield)

2013-03-31 Thread Neal Norwitz

New submission from Neal Norwitz:

 def foo():
...   if x:
... yield None
... 
 dis.dis(foo)
  2   0 LOAD_GLOBAL  0 (x)
  3 POP_JUMP_IF_FALSE   14

  3   6 LOAD_CONST   0 (None)
  9 YIELD_VALUE 
 10 POP_TOP 
 11 JUMP_FORWARD 0 (to 14)
   14 LOAD_CONST   0 (None)
 17 RETURN_VALUE


The JUMP_FORWARD at 11 is not necessary and is not in place with a return in 
the code:

 def foo():
...  if x:
...   return None
... 
 dis.dis(foo)
  2   0 LOAD_GLOBAL  0 (x)
  3 POP_JUMP_IF_FALSE   10

  3   6 LOAD_CONST   0 (None)
  9 RETURN_VALUE
   10 LOAD_CONST   0 (None)
 13 RETURN_VALUE

--
components: Interpreter Core
messages: 185708
nosy: Neal.Norwitz
priority: normal
severity: normal
status: open
title: missed peephole optimization (unnecessary jump at end of function after 
yield)
type: performance
versions: Python 2.7

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue17607
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com