<feed xmlns='http://www.w3.org/2005/Atom'>
<title>delta/cpython-git.git/Python/peephole.c, branch fix-misc-acks</title>
<subtitle>github.com: python/cpython.git
</subtitle>
<link rel='alternate' type='text/html' href='http://91.123.203.49/cgit/delta/cpython-git.git/'/>
<entry>
<title>[3.7] bpo-37500: Revert commit 85ed1712e428f93408f56fc684816f9a85b0ebc0 (GH-14605)</title>
<updated>2019-07-05T19:13:38+00:00</updated>
<author>
<name>Pablo Galindo</name>
<email>Pablogsal@gmail.com</email>
</author>
<published>2019-07-05T19:13:38+00:00</published>
<link rel='alternate' type='text/html' href='http://91.123.203.49/cgit/delta/cpython-git.git/commit/?id=7d93effeb4f8e86dfa283f2376ec5362275635c6'/>
<id>7d93effeb4f8e86dfa283f2376ec5362275635c6</id>
<content type='text'>
https://bugs.python.org/issue37500</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
https://bugs.python.org/issue37500</pre>
</div>
</content>
</entry>
<entry>
<title>bpo-37289: Remove 'if False' handling in the peephole optimizer (GH-14099) (GH-14111)</title>
<updated>2019-06-15T15:22:34+00:00</updated>
<author>
<name>Miss Islington (bot)</name>
<email>31488909+miss-islington@users.noreply.github.com</email>
</author>
<published>2019-06-15T15:22:34+00:00</published>
<link rel='alternate' type='text/html' href='http://91.123.203.49/cgit/delta/cpython-git.git/commit/?id=81fecf7b7a6e766a213c6e670219c1da52461589'/>
<id>81fecf7b7a6e766a213c6e670219c1da52461589</id>
<content type='text'>
(cherry picked from commit 7a68f8c28bb78d957555a5001dac4df6345434a0)

Co-authored-by: Pablo Galindo &lt;Pablogsal@gmail.com&gt;</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
(cherry picked from commit 7a68f8c28bb78d957555a5001dac4df6345434a0)

Co-authored-by: Pablo Galindo &lt;Pablogsal@gmail.com&gt;</pre>
</div>
</content>
</entry>
<entry>
<title>[3.7] bpo-37269: Correctly optimise conditionals with constant booleans (GH-14071) (GH-14073)</title>
<updated>2019-06-14T06:18:51+00:00</updated>
<author>
<name>Pablo Galindo</name>
<email>Pablogsal@gmail.com</email>
</author>
<published>2019-06-14T06:18:51+00:00</published>
<link rel='alternate' type='text/html' href='http://91.123.203.49/cgit/delta/cpython-git.git/commit/?id=5292179afc6fd0dc533add054d4790773c9766d0'/>
<id>5292179afc6fd0dc533add054d4790773c9766d0</id>
<content type='text'>
Fix a regression introduced by af8646c8054d0f4180a2013383039b6a472f9698 that was causing code of the form:

if True and False:
   do_something()

to be optimized incorrectly, eliminating the block..
(cherry picked from commit 05f831865545b08c9a21cfb7773af58b76ec64cb)

Co-authored-by: Pablo Galindo &lt;Pablogsal@gmail.com&gt;</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Fix a regression introduced by af8646c8054d0f4180a2013383039b6a472f9698 that was causing code of the form:

if True and False:
   do_something()

to be optimized incorrectly, eliminating the block..
(cherry picked from commit 05f831865545b08c9a21cfb7773af58b76ec64cb)

Co-authored-by: Pablo Galindo &lt;Pablogsal@gmail.com&gt;</pre>
</div>
</content>
</entry>
<entry>
<title>bpo-1875: Raise SyntaxError in invalid blocks that will be optimised away (GH-13332)</title>
<updated>2019-05-17T10:59:48+00:00</updated>
<author>
<name>Miss Islington (bot)</name>
<email>31488909+miss-islington@users.noreply.github.com</email>
</author>
<published>2019-05-17T10:59:48+00:00</published>
<link rel='alternate' type='text/html' href='http://91.123.203.49/cgit/delta/cpython-git.git/commit/?id=85ed1712e428f93408f56fc684816f9a85b0ebc0'/>
<id>85ed1712e428f93408f56fc684816f9a85b0ebc0</id>
<content type='text'>
Move the check for dead conditionals (if 0) to the peephole optimizer
and make sure that the code block is still compiled to report any
existing syntax errors within.
(cherry picked from commit af8646c8054d0f4180a2013383039b6a472f9698)

Co-authored-by: Pablo Galindo &lt;Pablogsal@gmail.com&gt;</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Move the check for dead conditionals (if 0) to the peephole optimizer
and make sure that the code block is still compiled to report any
existing syntax errors within.
(cherry picked from commit af8646c8054d0f4180a2013383039b6a472f9698)

Co-authored-by: Pablo Galindo &lt;Pablogsal@gmail.com&gt;</pre>
</div>
</content>
</entry>
<entry>
<title>[3.7] bpo-9566: Fix compiler warnings on Windows (GH-12920)</title>
<updated>2019-04-23T08:26:11+00:00</updated>
<author>
<name>Victor Stinner</name>
<email>vstinner@redhat.com</email>
</author>
<published>2019-04-23T08:26:11+00:00</published>
<link rel='alternate' type='text/html' href='http://91.123.203.49/cgit/delta/cpython-git.git/commit/?id=8a9a6b443c57e47e9d10ed7775479aada4dac719'/>
<id>8a9a6b443c57e47e9d10ed7775479aada4dac719</id>
<content type='text'>
* bpo-9566: Fix compiler warnings in gcmodule.c (GH-11010)

Change PyDTrace_GC_DONE() argument type from int to Py_ssize_t.

(cherry picked from commit edad38e3e05586ba58291f47756eb3fb808f5577)

* bpo-30465: Fix C downcast warning on Windows in ast.c (#6593)

ast.c: fstring_fix_node_location() downcasts a pointer difference to
a C int. Replace int with Py_ssize_t to fix the compiler warning.

(cherry picked from commit fb7e7992beec7f76cc2db77ab6ce1e86446bfccf)

* bpo-9566: Fix compiler warnings in peephole.c (GH-10652)

(cherry picked from commit 028f0ef4f3111d2b3fc5b971642e337ba7990873)

* bpo-27645, sqlite: Fix integer overflow on sleep (#6594)

Use the _PyTime_t type and round away from zero (ROUND_UP,
_PyTime_ROUND_TIMEOUT) the sleep duration, when converting a Python
object to seconds and then to milliseconds. Raise an OverflowError in
case of overflow.

Previously the (int)double conversion rounded towards zero
(ROUND_DOWN).

(cherry picked from commit ca405017d5e776a2e3d9291236e62d2e09489dd2)</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
* bpo-9566: Fix compiler warnings in gcmodule.c (GH-11010)

Change PyDTrace_GC_DONE() argument type from int to Py_ssize_t.

(cherry picked from commit edad38e3e05586ba58291f47756eb3fb808f5577)

* bpo-30465: Fix C downcast warning on Windows in ast.c (#6593)

ast.c: fstring_fix_node_location() downcasts a pointer difference to
a C int. Replace int with Py_ssize_t to fix the compiler warning.

(cherry picked from commit fb7e7992beec7f76cc2db77ab6ce1e86446bfccf)

* bpo-9566: Fix compiler warnings in peephole.c (GH-10652)

(cherry picked from commit 028f0ef4f3111d2b3fc5b971642e337ba7990873)

* bpo-27645, sqlite: Fix integer overflow on sleep (#6594)

Use the _PyTime_t type and round away from zero (ROUND_UP,
_PyTime_ROUND_TIMEOUT) the sleep duration, when converting a Python
object to seconds and then to milliseconds. Raise an OverflowError in
case of overflow.

Previously the (int)double conversion rounded towards zero
(ROUND_DOWN).

(cherry picked from commit ca405017d5e776a2e3d9291236e62d2e09489dd2)</pre>
</div>
</content>
</entry>
<entry>
<title>bpo-35193: Fix an off by one error in the RETURN_VALUE case. (GH-10418)</title>
<updated>2018-11-09T02:13:14+00:00</updated>
<author>
<name>Miss Islington (bot)</name>
<email>31488909+miss-islington@users.noreply.github.com</email>
</author>
<published>2018-11-09T02:13:14+00:00</published>
<link rel='alternate' type='text/html' href='http://91.123.203.49/cgit/delta/cpython-git.git/commit/?id=f16ebcd460aaeb8d6b31db317d22f5ed68afbcc8'/>
<id>f16ebcd460aaeb8d6b31db317d22f5ed68afbcc8</id>
<content type='text'>
Fix an off by one error in the peephole optimizer when checking for unreachable code beyond a return.

Do a bounds check within find_op so it can return before going past the end as a safety measure.

https://github.com/python/cpython/commit/7db3c488335168993689ddae5914a28e16188447GH-diff-a33329ae6ae0bb295d742f0caf93c137
introduced this off by one error while fixing another one nearby.

This bug was shipped in all Python 3.6 and 3.7 releases.

The included unittest won't fail unless you do a clang msan build.
(cherry picked from commit 49fa4a9f1ef387e16596f271414c855339eadf09)

Co-authored-by: Gregory P. Smith &lt;greg@krypto.org&gt;</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Fix an off by one error in the peephole optimizer when checking for unreachable code beyond a return.

Do a bounds check within find_op so it can return before going past the end as a safety measure.

https://github.com/python/cpython/commit/7db3c488335168993689ddae5914a28e16188447GH-diff-a33329ae6ae0bb295d742f0caf93c137
introduced this off by one error while fixing another one nearby.

This bug was shipped in all Python 3.6 and 3.7 releases.

The included unittest won't fail unless you do a clang msan build.
(cherry picked from commit 49fa4a9f1ef387e16596f271414c855339eadf09)

Co-authored-by: Gregory P. Smith &lt;greg@krypto.org&gt;</pre>
</div>
</content>
</entry>
<entry>
<title>bpo-29469: peephole: Remove const_stack (GH-4879)</title>
<updated>2017-12-18T06:52:54+00:00</updated>
<author>
<name>INADA Naoki</name>
<email>methane@users.noreply.github.com</email>
</author>
<published>2017-12-18T06:52:54+00:00</published>
<link rel='alternate' type='text/html' href='http://91.123.203.49/cgit/delta/cpython-git.git/commit/?id=87010e85cb37192d63b1a30e5fabba307ad5a3f5'/>
<id>87010e85cb37192d63b1a30e5fabba307ad5a3f5</id>
<content type='text'>
Constant folding was moved to AST optimizer.
But compiler may emit LOAD_CONSTs + BUILD_TUPLE.
For example, default arguments can be constant tuple
if all arguments are constant.

This commit makes peephole's tuple folding simple.
It doesn't support nested tuples because nested
tuples are folded by AST optimizer already.</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Constant folding was moved to AST optimizer.
But compiler may emit LOAD_CONSTs + BUILD_TUPLE.
For example, default arguments can be constant tuple
if all arguments are constant.

This commit makes peephole's tuple folding simple.
It doesn't support nested tuples because nested
tuples are folded by AST optimizer already.</pre>
</div>
</content>
</entry>
<entry>
<title>bpo-29469: Optimize literal lists and sets iterating on the AST level. (#4866)</title>
<updated>2017-12-14T18:24:31+00:00</updated>
<author>
<name>Serhiy Storchaka</name>
<email>storchaka@gmail.com</email>
</author>
<published>2017-12-14T18:24:31+00:00</published>
<link rel='alternate' type='text/html' href='http://91.123.203.49/cgit/delta/cpython-git.git/commit/?id=15a8728415e765f57e37f431f09e5c5821a04063'/>
<id>15a8728415e765f57e37f431f09e5c5821a04063</id>
<content type='text'>
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
</pre>
</div>
</content>
</entry>
<entry>
<title>bpo-29469: Remove unnecessary peephole optimizer (GH-4863)</title>
<updated>2017-12-14T13:18:26+00:00</updated>
<author>
<name>INADA Naoki</name>
<email>methane@users.noreply.github.com</email>
</author>
<published>2017-12-14T13:18:26+00:00</published>
<link rel='alternate' type='text/html' href='http://91.123.203.49/cgit/delta/cpython-git.git/commit/?id=eadad1b97f64619bfd246b9d3b60d25f456e0592'/>
<id>eadad1b97f64619bfd246b9d3b60d25f456e0592</id>
<content type='text'>
Conversions like `not a is b -&gt; a is not b` are implemented
in AST optimizer in previous commit (7ea143a).
So this commit removes them from peephole optimizer.</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Conversions like `not a is b -&gt; a is not b` are implemented
in AST optimizer in previous commit (7ea143a).
So this commit removes them from peephole optimizer.</pre>
</div>
</content>
</entry>
<entry>
<title>bpo-29469: Move constant folding to AST optimizer (GH-2858)</title>
<updated>2017-12-14T07:47:20+00:00</updated>
<author>
<name>INADA Naoki</name>
<email>methane@users.noreply.github.com</email>
</author>
<published>2017-12-14T07:47:20+00:00</published>
<link rel='alternate' type='text/html' href='http://91.123.203.49/cgit/delta/cpython-git.git/commit/?id=7ea143ae795a9fd57eaccf490d316bdc13ee9065'/>
<id>7ea143ae795a9fd57eaccf490d316bdc13ee9065</id>
<content type='text'>
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
</pre>
</div>
</content>
</entry>
</feed>
