Serhiy Storchaka <storchaka+cpyt...@gmail.com> 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 defined locally in this file. If move 
these two functions in a separate file we will need to move these 4 structures 
and related definitions to the common header file. And maybe it will be in vain 
if once all these optimizations will be moved to other parts of the compiler. 
Some of jumps optimization already are performed on instructions emitting 
stage. Dead code elimination perhaps could be performed at the stage of 
assembling the bytecode from basic blocks. Constant tuples folding could be 
implemented by at least three ways besides the current implementation, I'm 
testing what of them is the simplest.

----------

_______________________________________
Python tracker <rep...@bugs.python.org>
<https://bugs.python.org/issue32477>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com

Reply via email to