bpo-37271: Optimize bytecode multiple times until it cannot be optimized further by pablogsal · Pull Request #14068 · python/cpython
@nedbat Sure, I will talk with Victor to see if we can push it forward.
pablogsal
changed the title
Optimize bytecode multiple times until it cannot be optimized further
bpo-37271: Optimize bytecode multiple times until it cannot be optimized further
pablogsal
marked this pull request as ready for review
I have rebased and address the feedback. Also, I have added a max cap of iterations (although is not needed, it can be proven that the while loop will always finish) to make sure the time expended in the loop is always bounded.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good in general, just a couple of questions.
@markshannon I have added some comments as requested, check if they look good to you :)
This is the code that is failing the assert currently:
def f(cond1, cond2):
while 1:
return 3
while 1:
return 5
return 6