Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
120 commits
Select commit Hold shift + click to select a range
21acfcf
Comment out all C-level changes
esc Jul 29, 2022
32d27f1
implement new Python 3.11 opcode: RESUME
esc Aug 22, 2022
b075c04
bump max python version
esc Feb 25, 2022
c95f49b
Merge branches 'python3.11_partial/version_bump', 'python3.11_partial…
esc Aug 22, 2022
ae1d835
Minimal changes to get a basic integer sum reduction for loop working…
sklam Aug 24, 2022
3ad2849
Get more jump opcodes
sklam Aug 26, 2022
3ad0bb3
Ignore the NULL push from LOAD_GLOBAL.
sklam Aug 29, 2022
aee2b5e
Add more BACKWARD jump and PUSH_NULL.
sklam Sep 9, 2022
6f1b5b2
Fix backward jump offset
sklam Sep 9, 2022
c529ccb
Support KW_NAMES and getting looplifting to work
sklam Sep 14, 2022
6652856
Support RETURN_GENERATOR
sklam Sep 14, 2022
18614b5
Don't dump CACHE bytecode
sklam Sep 14, 2022
77c2672
Partially support MAKE_FUNCTION
sklam Sep 14, 2022
377f68a
Leave comment about co_qualname changes in MAKE_FUNCTION
sklam Sep 14, 2022
00d5df1
Support BEFORE_WITH
sklam Sep 20, 2022
d15b686
Support with-lifting
sklam Sep 28, 2022
2905234
Support JUMP_IS_NONE
sklam Sep 28, 2022
e2588bd
Upgrade cloudpickle to version v2.2.0
sklam Sep 29, 2022
ed88da1
Support py3.11 try-except
sklam Oct 8, 2022
ba5910f
Merge branch 'main' into py3.11wip
sklam Oct 26, 2022
0475915
Flake8 fixes
sklam Oct 26, 2022
ba6dabe
More flake8 fix
sklam Oct 26, 2022
ce358c9
Fix older python
sklam Oct 26, 2022
7c92fcb
Temporarily disable compilation warnings
sklam Oct 26, 2022
0d1ed69
Unbreak python <3.11
sklam Oct 26, 2022
cd328e6
Unbreak py3.10 builds
sklam Oct 26, 2022
ed3618d
Fix py3.10 failure
sklam Oct 26, 2022
8c72be3
Restore #7388 fixes
sklam Oct 27, 2022
80ed533
Fix try except in py<3.11
sklam Nov 2, 2022
bd4dd4f
Fix inplace op
sklam Nov 8, 2022
fbb33c0
Fix hashing support in py<3.11
sklam Nov 9, 2022
d8f5c8c
Setup Azure CI to test py3.11
sklam Nov 10, 2022
3c2d489
Merge pull request #8598 from sklam/misc/py3.11ci
sklam Nov 14, 2022
ae88ee2
Skip testing by git diff for now
sklam Nov 16, 2022
c39b660
Fix CI test run
sklam Nov 16, 2022
a0382bf
Remove pickle5, doc build in CI
sklam Nov 16, 2022
4158513
Fix arrayexprs for py3.11
sklam Nov 9, 2022
0c3f3f9
Fix LOAD_GLOBAL arg use in test_parfors for py3.11
sklam Nov 9, 2022
6a339cd
Move _fix_LOAD_GLOBAL_arg to bytecode module and use it in _compute_u…
sklam Nov 9, 2022
38eeb99
Fix test_flow_control for py3.11
sklam Nov 9, 2022
4839ecd
(Not a py311 change) stop printing source code
sklam Nov 16, 2022
591d86b
Attempt to fix cellvars
sklam Nov 16, 2022
6db234d
Fix CodeType usage
sklam Nov 17, 2022
4436f5d
Remove duplicated handling of CodeType.
sklam Nov 17, 2022
626ee8c
Flake8 fixes
sklam Nov 18, 2022
b7e5aeb
More flake8 fixes
sklam Nov 18, 2022
57e5e33
Copy in struct _frame from cpython 3.11 source code to regain access …
sklam Nov 21, 2022
c8c759b
Adds compiler warning for stub code
sklam Nov 21, 2022
bcc619a
Use _FIXED_OFFSET instead of a inline literal number
sklam Nov 21, 2022
08c89b6
Enable list_to_tuple peephole for py3.11
sklam Nov 23, 2022
120ca92
Rename base ByteCode class to _ByteCode
sklam Nov 23, 2022
455fd62
Apply some review suggestions in byteflow.py
sklam Nov 23, 2022
74cb0db
Address reviews on byteflow.py
sklam Nov 30, 2022
7d4b97c
Make PYVERSION check more consistent
sklam Nov 30, 2022
09c99ab
Rewrite peep_hole_split_at_pop_block.
sklam Nov 30, 2022
d902819
Address reviews in interpreter.py
sklam Nov 30, 2022
a53148c
Remove dead code: StaticReraise
sklam Nov 30, 2022
8c29da3
Address review in transforms.py
sklam Nov 30, 2022
9a397d2
One more PYVERSION guard for newer versions
sklam Nov 30, 2022
68fcc65
Merge branch 'py3.11wip' into py3.11motto
sklam Nov 30, 2022
88f87e8
Assert to guard against newer python versions
sklam Nov 30, 2022
d8740e8
Apply suggestions from code review
sklam Dec 1, 2022
eae8e01
Merge pull request #8545 from sklam/py3.11wip
sklam Dec 1, 2022
8bfaf09
Merge branch 'py3.11' into py3.11motto
sklam Dec 1, 2022
ac80942
Update numba/core/byteflow.py
sklam Dec 2, 2022
34641df
Get rid of custom copy_code_type. Use CodeType.replace instead.
sklam Dec 2, 2022
61e6a51
Merge pull request #8590 from sklam/py3.11motto
sklam Dec 2, 2022
c96fa09
Update string/bytes hash algs to siphash13 for Python 3.11
stuartarchibald Nov 21, 2022
34e2ed7
Fix flake8
stuartarchibald Nov 22, 2022
7c067fe
Attempt to fix closures.
stuartarchibald Nov 24, 2022
2d8c06b
Enable more peephole rewrites in 3.11
stuartarchibald Nov 24, 2022
d6c2f69
Fix test_dump_bytecode.
stuartarchibald Nov 25, 2022
c031e05
Fix f-string const name interp.
stuartarchibald Nov 25, 2022
f9ce8b4
Rewrite _jump_if_none to match pre-py3.11
stuartarchibald Nov 25, 2022
b6b0ecf
Fix near and far jump target ordering.
stuartarchibald Nov 25, 2022
5daaf34
Add more new op code handling.
stuartarchibald Nov 25, 2022
f296d79
Fix issue with EXTENDED_ARG test and update test support for code obj.
stuartarchibald Nov 25, 2022
1d3056d
Add pop NULL to CALL_FUNCTION_EX byteflow analysis.
stuartarchibald Nov 28, 2022
64743c9
Fix out of bounds loop index in test.
stuartarchibald Nov 28, 2022
4a1031a
Accommodate multiple bytecodes at block start with no line number.
stuartarchibald Nov 28, 2022
c2a243b
Fix parfors prange test generator LOAD_GLOBAL args.
stuartarchibald Nov 28, 2022
c0cd45b
Update assertion for Python 3.11 style error messages
stuartarchibald Nov 29, 2022
1af5b2c
Fix bytecode iteration to handle EXTENDED_ARG as jump target.
stuartarchibald Nov 29, 2022
b08e4da
Fix rebase error in op_LOAD_DEREF
stuartarchibald Dec 5, 2022
9bffd78
Respond to feedback RE use of `_is_null_temp_reg` in byteflow.py
stuartarchibald Dec 5, 2022
8543e6a
Fix binop names to be legal variable names.
stuartarchibald Dec 5, 2022
25a89af
Update `test_extended_arg` to use CodeType.replace()
stuartarchibald Dec 5, 2022
cce7627
Merge pull request #8639 from stuartarchibald/wip/py311_cont_3
sklam Dec 5, 2022
6303755
Fix bare reraise support
sklam Dec 6, 2022
88623a8
Tracing updates for python 3.11
Dec 6, 2022
61f5c36
Removed duplicate definition of python 3.11 _frame
Dec 6, 2022
9713453
Merge pull request #8644 from sklam/fix/py311_reraise
sklam Dec 6, 2022
e1807ae
Additional updates for Python 3.11 tracing support
Dec 13, 2022
85b7979
Fix frame used for profiling.
sklam Jan 12, 2023
0064124
Use internal CPython includes to avoid copying in code
sklam Jan 18, 2023
14fac9f
Add comments about the changes
sklam Jan 19, 2023
08acc87
Suppress known test failure for py3.11
sklam Feb 9, 2023
8abc9a1
Merge pull request #8680 from thomasjpfan/flake8_6.0_error
sklam Jan 25, 2023
eada2e5
Merge pull request #8728 from stuartarchibald/wip/fixes_for_flake8_ve…
esc Jan 26, 2023
6ff1bf2
Merge pull request #8752 from sklam/misc/py311_flake8_fix
sklam Feb 14, 2023
ef20214
Suppress failure for numba.tests.test_profiler.TestProfiler.test_prof…
sklam Feb 15, 2023
36ef812
Fix undefined variable in test_pow
sklam Feb 15, 2023
7113b07
Bump llvmlite PR in testing for py3.11 to suppress deprecation warning
sklam Feb 15, 2023
67857fb
Merge pull request #8748 from sklam/misc/suppress_error_py311
sklam Feb 15, 2023
b91e31d
Merge pull request #8760 from sklam/misc/py3.11_llvmlite
sklam Feb 16, 2023
c6ef422
Merge remote-tracking branch 'origin/py3.11' into temp/pr/8670
sklam Feb 16, 2023
2805e55
Undo unexpected success on numba.tests.test_profiler.TestProfiler.tes…
sklam Feb 16, 2023
4d23d15
Fix hardcoded PyTrace_CALL in call_trace
sklam Mar 2, 2023
fb3d492
Update numba/_dispatcher.cpp
sklam Mar 2, 2023
27dd56a
Merge pull request #8711 from sklam/temp/pr/8670
sklam Mar 9, 2023
8a897f5
Merge commit 'ec5210242e400d281d6c52d633ce041f95f47e98' into misc/py3…
sklam Mar 16, 2023
c7b9c9a
Resolve conflicts.
sklam Mar 16, 2023
0375955
Bump python version guard
sklam Mar 14, 2023
3de4e98
Fix py3.10
sklam Mar 14, 2023
150142b
Unblock test for python 3.11
sklam Mar 15, 2023
f891b0a
Fix buildscripts to point to llvmdev=14
sklam Mar 14, 2023
c4168f1
Merge pull request #8831 from sklam/misc/py3.11merge_redo
sklam Mar 21, 2023
df76454
Merge remote-tracking branch 'origin/py3.11' into main.
sklam Mar 21, 2023
1fb49d3
Remove expectedFailure for py3.11 branch
sklam Mar 16, 2023
fff30e1
Add py3.11 ci config
sklam Mar 16, 2023
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Flake8 fixes
  • Loading branch information
sklam committed Oct 26, 2022
commit 04759154a8ec0b2769ffbc1061620e54086b51da
1 change: 1 addition & 0 deletions numba/core/bytecode.py
Original file line number Diff line number Diff line change
Expand Up @@ -328,6 +328,7 @@ def find_exception_entry(self, offset):
ent = max(candidates)[1]
return ent


class FunctionIdentity(serialize.ReduceMixin):
"""
A function's identity and metadata.
Expand Down
22 changes: 13 additions & 9 deletions numba/core/byteflow.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
from numba.core.utils import UniqueDict, PYVERSION
from numba.core.controlflow import NEW_BLOCKERS, CFGraph
from numba.core.ir import Loc
from numba.core.errors import UnsupportedError, CompilerError
from numba.core.errors import UnsupportedError


_logger = logging.getLogger(__name__)
Expand Down Expand Up @@ -113,7 +113,8 @@ def run(self):
# Terminated?
if state.has_terminated():
break
elif not state.in_with() and (state.has_active_try() and
elif not state.in_with() and (
state.has_active_try() and
state.get_inst().opname not in _NO_RAISE_OPS):
# Is in a *try* block
state.fork(pc=state.get_inst().next)
Expand All @@ -125,18 +126,21 @@ def run(self):
# Must the new PC be a new block?
if PYVERSION == (3, 11):
if not state.in_with() and state.is_in_exception():
_logger.debug("3.11 exception %s PC=%s", state.get_exception(), state._pc)
_logger.debug("3.11 exception %s PC=%s",
state.get_exception(), state._pc)
eh = state.get_exception()
eh_top = state.get_top_block('TRY')
if eh_top and eh_top['end'] == eh.target:
# Same exception
eh_block = None
else:
eh_block = state.make_block("TRY", end=eh.target)
eh_block = state.make_block(
"TRY", end=eh.target)
eh_block['end_offset'] = eh.end
eh_block['stack_depth'] = eh.depth
eh_block['push_lasti'] = eh.lasti
state.fork(pc=state._pc, extra_block=eh_block)
state.fork(pc=state._pc,
extra_block=eh_block)
break

if self._is_implicit_new_block(state):
Expand Down Expand Up @@ -839,7 +843,6 @@ def op_BEFORE_WITH(self, state, inst):
# Forces a new block
state.fork(pc=inst.next)


def op_SETUP_WITH(self, state, inst):
cm = state.pop() # the context-manager

Expand Down Expand Up @@ -891,7 +894,6 @@ def op_PUSH_EXC_INFO(self, state, inst):
state.push(state.make_temp("exception"))
state.push(tos)


def op_SETUP_EXCEPT(self, state, inst):
# Opcode removed since py3.8
state.append(inst)
Expand All @@ -913,7 +915,7 @@ def op_POP_EXCEPT(self, state, inst):
blk = state.pop_block()
if blk['kind'] not in {BlockKind('EXCEPT'), BlockKind('FINALLY')}:
raise UnsupportedError(
"POP_EXCEPT got an unexpected block: {}".format(blk['kind']),
f"POP_EXCEPT got an unexpected block: {blk['kind']}",
loc=self.get_debug_loc(inst.lineno),
)
state.pop()
Expand Down Expand Up @@ -1648,7 +1650,8 @@ def get_outgoing_states(self):
for edge in self._outedges:
state = State(bytecode=self._bytecode, pc=edge.pc,
nstack=len(edge.stack), blockstack=edge.blockstack,
nullvals=[i for i, v in enumerate(edge.stack) if _is_null_temp_reg(v)])
nullvals=[i for i, v in enumerate(edge.stack)
if _is_null_temp_reg(v)])
ret.append(state)
# Map outgoing_phis
for phi, i in state._phis.items():
Expand Down Expand Up @@ -1695,6 +1698,7 @@ def in_with(self):
if ent["kind"] == BlockKind("WITH"):
return True


if PYVERSION >= (3, 11):
State = StatePy311

Expand Down
4 changes: 3 additions & 1 deletion numba/core/controlflow.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,9 @@

# List of bytecodes creating a new block in the control flow graph
# (in addition to explicit jump labels).
NEW_BLOCKERS = frozenset(['SETUP_LOOP', 'FOR_ITER', 'SETUP_WITH', 'BEFORE_WITH'])
NEW_BLOCKERS = frozenset([
'SETUP_LOOP', 'FOR_ITER', 'SETUP_WITH', 'BEFORE_WITH'
])


class CFBlock(object):
Expand Down
5 changes: 2 additions & 3 deletions numba/core/interpreter.py
Original file line number Diff line number Diff line change
Expand Up @@ -1520,7 +1520,6 @@ def _start_new_block(self, offset):
if newtryblk is not tryblk:
self._insert_try_block_begin()


def _end_current_block(self):
# Handle try block
if not self.current_block.is_terminated:
Expand Down Expand Up @@ -2816,7 +2815,7 @@ def _jump_if_none(self, inst, pred, iftrue):
op = BINOPS_TO_OPERATORS["is"]

lhs = self.store(value=ir.Const(None, loc=self.loc),
name="${inst.offset}constnone")
name="${inst.offset}constnone")
rhs = self.get(pred)
isnone = ir.Expr.binop(op, lhs=lhs, rhs=rhs, loc=self.loc)

Expand Down Expand Up @@ -2898,7 +2897,7 @@ def op_RERAISE(self, inst, exc):
# Numba can't handle this case and it's caught else where, this is a
# runtime guard in case this is reached by unknown means.
msg = (f"Unreachable condition reached (op code RERAISE executed)"
f"{error_extras['reportable']}")
f"{error_extras['reportable']}")
stmt = ir.StaticRaise(AssertionError, (msg,), self.loc)
self.current_block.append(stmt)

Expand Down
4 changes: 3 additions & 1 deletion numba/core/lowering.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@

_VarArgItem = namedtuple("_VarArgItem", ("vararg", "index"))


class BaseLower(object):
"""
Lower IR to LLVM
Expand Down Expand Up @@ -304,7 +305,8 @@ def typeof(self, varname):

def debug_print(self, msg):
if config.DEBUG_JIT:
self.context.debug_print(self.builder, f"DEBUGJIT [{self.fndesc.qualname}]: {msg}")
self.context.debug_print(
self.builder, f"DEBUGJIT [{self.fndesc.qualname}]: {msg}")

def print_variable(self, msg, varname):
"""Helper to emit ``print(msg, varname)`` for debugging.
Expand Down