
On 10/23/2015 4:23 AM, Victor Stinner wrote:
Hi,
2015-10-22 19:02 GMT+02:00 Brett Cannon <brett@python.org>:
It's not specified anywhere; it's just what the peepholer decides to remove. The exact code can be found at https://hg.python.org/cpython/file/default/Python/peephole.c . There has been talk in the past for adding a -X flag to disable the peepholer, but it never went any farther beyond that.
Yeah, I remember that I had the same issue than Stéphane when I worked on my astoptimizer project :-) I wanted to completly disable the peephole optimizer because I wanted to reimplement the optimizations on the AST instead of rewriting the bytecode.
I would be nice to have a "-X noopt" command line option for that.
How about -x nopeep to specifically skip the peephole optimizer? -- Terry Jan Reedy

2015-10-24 4:34 GMT+09:00 Terry Reedy <tjreedy@udel.edu>:
How about -x nopeep to specifically skip the peephole optimizer?
Raymond wrote "IIRC, the code was never generated in the first place (before the peephole pass)." So "nopeep" would have a different purpose. Victor

On 10/26/2015 10:36 PM, Victor Stinner wrote:
2015-10-24 4:34 GMT+09:00 Terry Reedy <tjreedy@udel.edu>:
How about -x nopeep to specifically skip the peephole optimizer?
Raymond wrote "IIRC, the code was never generated in the first place (before the peephole pass)."
I based that suggestion on what others said about why code was not generated. I think the actual situation supports my point that turning off 'all optimizations' means reviewing the entire process of generating code, from start to finish, to find anything that might be called an 'optimization' and that could be disabled or given a 'un-optimized' alternative. -- Terry Jan Reedy
participants (2)
-
Terry Reedy
-
Victor Stinner