Raymond Hettinger <[EMAIL PROTECTED]> added the comment: This one does give a real speedup in the case of jumping to a UNARY_NOT followed by another conditional jump.
My only issue is that it doesn't make it's transformation all at once. It relies on a subsequent pass to not change its assumptions. This tightly couples two pieces of peephole logic that are best left fully orthogonal lest we introduct maintenance problems. The fragility is compounded because a new basic block is formed and that is not recorded in the structure designed to track the blocks. At some point, many of the peephole optimizations are going to be moved upstream into a AST optimizer. That is a more appropriate place for this kind of transformation. Am closing this because it makes the code too fragile, but I think the idea was inspired and the implementation was clever. Thanks for the patch. ---------- nosy: +rhettinger resolution: -> rejected status: open -> closed _______________________________________ Python tracker <[EMAIL PROTECTED]> <http://bugs.python.org/issue1765558> _______________________________________ _______________________________________________ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com