[issue1346238] A constant folding optimization pass for the AST

2017-12-14 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: Have been implemented in issue29469. -- nosy: +serhiy.storchaka resolution: -> duplicate stage: -> resolved status: open -> closed superseder: -> AST-level Constant folding ___

[issue1346238] A constant folding optimization pass for the AST

2017-01-27 Thread Raymond Hettinger
Raymond Hettinger added the comment: I applaud any effort to move constant folding out of the peepholer and into AST. -- ___ Python tracker ___

[issue1346238] A constant folding optimization pass for the AST

2017-01-27 Thread INADA Naoki
Changes by INADA Naoki : -- nosy: +inada.naoki ___ Python tracker ___ ___

[issue1346238] A constant folding optimization pass for the AST

2014-01-02 Thread STINNER Victor
STINNER Victor added the comment: My astoptimizer project has an experimental support of constant folding. It works in the same file, or constants can be propagated to other files using config.add_constant('NAME', value). https://bitbucket.org/haypo/astoptimizer/ -- nosy: +haypo

[issue1346238] A constant folding optimization pass for the AST

2013-12-31 Thread Paul Sokolovsky
Paul Sokolovsky added the comment: 8 years after the original patch, there's still no trivial constant folding in bytecode generated (because peephole of course is not a real optimizer to consistently catch all cases): $ cat const.py FOO = 1 BAR = FOO + 2 + 4 $ python --version Python 2.7.3

[issue1346238] A constant folding optimization pass for the AST

2011-03-18 Thread Terry J. Reedy
Terry J. Reedy tjre...@udel.edu added the comment: #11549 Rewrite peephole to work on AST includes constant folding. I have not compared. -- nosy: +terry.reedy versions: +Python 3.3 -Python 3.2 ___ Python tracker rep...@bugs.python.org

[issue1346238] A constant folding optimization pass for the AST

2010-11-05 Thread Dave Malcolm
Dave Malcolm dmalc...@redhat.com added the comment: FWIW, I'm working on fixing up the this patch to work against py3k; I'm assuming there's still interest in the AST visitor + specific optimization passes approach. -- ___ Python tracker

[issue1346238] A constant folding optimization pass for the AST

2010-11-05 Thread Antoine Pitrou
Changes by Antoine Pitrou pit...@free.fr: -- nosy: +benjamin.peterson versions: +Python 3.2 -Python 2.6 ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue1346238 ___

[issue1346238] A constant folding optimization pass for the AST

2010-11-05 Thread Raymond Hettinger
Raymond Hettinger rhettin...@users.sourceforge.net added the comment: David, it would be great if an optional AST optimization pass could do something that we don't already have (perhaps, loop invariant code motion when python is called with -OO or somesuch). The AST tree makes it possible

[issue1346238] A constant folding optimization pass for the AST

2010-11-05 Thread Dave Malcolm
Dave Malcolm dmalc...@redhat.com added the comment: I've been working on this against the py3k branch. I'm attaching what I've got so far. I foolishly didn't check the tlee-ast-optimize branch, instead using file6850 as a base. Rune Holm/titanstar, I assume you've signed a PSF contributor

[issue1346238] A constant folding optimization pass for the AST

2010-11-05 Thread Dave Malcolm
Dave Malcolm dmalc...@redhat.com added the comment: Another optimization idea: detect local dictionaries that are only ever used in non-mutating ways, and convert them to constants, rather than rebuilding the dict from scratch each time. See e.g. htmlparser.py:adjustSVGAttributes etc within

[issue1346238] A constant folding optimization pass for the AST

2010-11-05 Thread Alex
Alex alex.gay...@gmail.com added the comment: ISTM that you don't need to worry about mutating locals, the locals() function is explicitly documented as not necessarily affecting local variables (not sure if frame objects have the same documentation). If you want a free optimization

[issue1346238] A constant folding optimization pass for the AST

2010-10-30 Thread Dave Malcolm
Changes by Dave Malcolm dmalc...@redhat.com: -- nosy: +dmalcolm ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue1346238 ___ ___ Python-bugs-list

[issue1346238] A constant folding optimization pass for the AST

2010-10-30 Thread Georg Brandl
Changes by Georg Brandl ge...@python.org: -- nosy: -georg.brandl, georg.brandl ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue1346238 ___ ___

[issue1346238] A constant folding optimization pass for the AST

2009-03-31 Thread Jeremy Hylton
Changes by Jeremy Hylton jer...@alum.mit.edu: -- priority: high - normal ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue1346238 ___ ___

[issue1346238] A constant folding optimization pass for the AST

2008-05-08 Thread Jeremy Hylton
Changes by Jeremy Hylton [EMAIL PROTECTED]: -- nosy: +jhylton _ Tracker [EMAIL PROTECTED] http://bugs.python.org/issue1346238 _ ___ Python-bugs-list mailing list

[issue1346238] A constant folding optimization pass for the AST

2008-05-07 Thread Thomas Lee
Thomas Lee [EMAIL PROTECTED] added the comment: I'm working on the AST optimization code for 2.7 (?) in the tlee-ast-optimize branch. I've since adopted some of the ideas from this patch, but I'll take another look when I get a chance. The folding operation is already mostly in-place.

[issue1346238] A constant folding optimization pass for the AST

2008-03-28 Thread Alexander Belopolsky
Alexander Belopolsky [EMAIL PROTECTED] added the comment: Raymond wrote in his recent response on issue2499 (a patch that adds unary '+' and 'not' folding to peephole optimizer): More importantly, we decided that the peepholer is the wrong place to do much of this work. Most of the