[issue32477] Move jumps optimization from the peepholer to the compiler

2019-06-15 Thread Serhiy Storchaka
Change by Serhiy Storchaka : -- versions: +Python 3.9 -Python 3.8 ___ Python tracker ___ ___ Python-bugs-list mailing list

[issue32477] Move jumps optimization from the peepholer to the compiler

2019-06-15 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: PR 14116 is based on the part of PR 5077. It serves three functions: * Finally fixes issue1875. * Simplifies the code. Removes special cases for "if 0" and "while 1". 31 insertions, 80 deletions in Python/compile.c + Python/peephole.c. * However such

[issue32477] Move jumps optimization from the peepholer to the compiler

2019-06-15 Thread Serhiy Storchaka
Change by Serhiy Storchaka : -- pull_requests: +13966 pull_request: https://github.com/python/cpython/pull/14116 ___ Python tracker ___

[issue32477] Move jumps optimization from the peepholer to the compiler

2019-06-10 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: Opened issue37213 for the regression in the peepholer. -- ___ Python tracker ___ ___

[issue32477] Move jumps optimization from the peepholer to the compiler

2019-03-07 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: After analyzing the difference between bytecodes generated by the current peepholer and the new optimizer I have found that he peepholer do not optimizes jumps in case of some multiline expressions. For example: [x for x in a if x] 1 0

[issue32477] Move jumps optimization from the peepholer to the compiler

2018-12-03 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: Simplified PR 5077. It uses now NEXT_BLOCK() to guarantee that a new block is always used after jumps. NEXT_BLOCK() was defined, but not used before. bpo-35193 and bpo-9566 demonstrate that the code of peephole.c is complex and error-prone. Moving it to

[issue32477] Move jumps optimization from the peepholer to the compiler

2018-01-03 Thread Antoine Pitrou
Antoine Pitrou added the comment: Well, on the other hand, the change you're proposing is hardly necessary, unless it actually demonstrates a noticeable improvement on some workload. So perhaps we should leave the peepholer alone until someone has a better idea. --

[issue32477] Move jumps optimization from the peepholer to the compiler

2018-01-03 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: > I think it's valuable to have a separate C module for optimizations, instead > of cramming them in compiler.c. This would require major rewriting. PR 5077 adds just two functions in compile.c. But they use 4 structures

[issue32477] Move jumps optimization from the peepholer to the compiler

2018-01-03 Thread Antoine Pitrou
Antoine Pitrou added the comment: > But some peephole optimizations will work with the intermediate fixed-size > representations used by the compiler, before generating the concrete bytecode. Then perhaps the goal should be to make the peephole operate on that intermediate

[issue32477] Move jumps optimization from the peepholer to the compiler

2018-01-03 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: Actually moving any of remaining optimizations (including two optimizations that are moved by this issue and two other that are left) slightly increases the complexity. But instead the optimizations become more general. At the

[issue32477] Move jumps optimization from the peepholer to the compiler

2018-01-03 Thread Raymond Hettinger
Raymond Hettinger added the comment: > This is a step to getting rid of the peepholer. There is no goal to get rid of the peepholer optimizer. Please don't invent this as a requirement. If some optimization are more easily performed upstream, then go ahead and

[issue32477] Move jumps optimization from the peepholer to the compiler

2018-01-02 Thread Serhiy Storchaka
Change by Serhiy Storchaka : -- nosy: +inada.naoki, pitrou ___ Python tracker ___

[issue32477] Move jumps optimization from the peepholer to the compiler

2018-01-01 Thread Serhiy Storchaka
Change by Serhiy Storchaka : -- keywords: +patch pull_requests: +4952 stage: -> patch review ___ Python tracker ___

[issue32477] Move jumps optimization from the peepholer to the compiler

2018-01-01 Thread Serhiy Storchaka
New submission from Serhiy Storchaka : The proposed patch moves jumps optimization from the peepholer to the compiler. The optimization is performed for lists of instructions before generating concrete bytecode and is not restricted by the size of bytecode