gh-131798: Optimize _ITER_CHECK_RANGE and _ITER_CHECK_LIST in the JIT#144583
gh-131798: Optimize _ITER_CHECK_RANGE and _ITER_CHECK_LIST in the JIT#144583Sacul0457 wants to merge 5 commits intopython:mainfrom
_ITER_CHECK_RANGE and _ITER_CHECK_LIST in the JIT#144583Conversation
|
Most changes to Python require a NEWS entry. Add one using the blurb_it web app or the blurb command-line tool. If this change has little impact on Python users, wait for a maintainer to apply the |
Oops, we in fact can test for But for Testcase: def testfunc(n):
x = 0
for _ in range(n):
r = range(1, 2)
for num in r: # guarded
x += num
for num in r: # unguarded
x += num
return x
Trace Produced: |
_ITER_CHECK_RANGE and _ITER_CHECK_LIST_ITER_CHECK_RANGE and _ITER_CHECK_LIST in the JIT
|
Uhm, anything else I have to do here? |
|
Hi @Fidget-Spinner! |
Adds
_ITER_CHECK_RANGEand_ITER_CHECK_LISTto the optimizer.Regarding testing, as far as I know, we can't accurately test for this optimization, similar to #134803.
But if I am mistaken, please let me know :)