Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
2 changes: 0 additions & 2 deletions docs/source/developer/repomap.rst
Original file line number Diff line number Diff line change
Expand Up @@ -117,8 +117,6 @@ Compiler Pipeline
Numba IR
- :ghfile:`numba/core/analysis.py` - Utility functions to analyze Numba IR
(variable lifetime, prune branches, etc)
- :ghfile:`numba/core/dataflow.py` - Dataflow analysis for Python bytecode (used
in analysis.py)
- :ghfile:`numba/core/controlflow.py` - Control flow analysis of Numba IR and
Python bytecode
- :ghfile:`numba/core/typeinfer.py` - Type inference algorithm
Expand Down
37 changes: 8 additions & 29 deletions numba/core/byteflow.py
Original file line number Diff line number Diff line change
Expand Up @@ -1104,35 +1104,14 @@ def op_MAKE_FUNCTION(self, state, inst, MAKE_CLOSURE=False):
name = state.pop()
code = state.pop()
closure = annotations = kwdefaults = defaults = None
if PYVERSION < (3, 6):
num_posdefaults = inst.arg & 0xFF
num_kwdefaults = (inst.arg >> 8) & 0xFF
num_annotations = (inst.arg >> 16) & 0x7FFF
if MAKE_CLOSURE:
closure = state.pop()
if num_annotations > 0:
annotations = state.pop()
if num_kwdefaults > 0:
kwdefaults = []
for i in range(num_kwdefaults):
v = state.pop()
k = state.pop()
kwdefaults.append((k, v))
kwdefaults = tuple(kwdefaults)
if num_posdefaults:
defaults = []
for i in range(num_posdefaults):
defaults.append(state.pop())
defaults = tuple(defaults)
else:
if inst.arg & 0x8:
closure = state.pop()
if inst.arg & 0x4:
annotations = state.pop()
if inst.arg & 0x2:
kwdefaults = state.pop()
if inst.arg & 0x1:
defaults = state.pop()
if inst.arg & 0x8:
closure = state.pop()
if inst.arg & 0x4:
annotations = state.pop()
if inst.arg & 0x2:
kwdefaults = state.pop()
if inst.arg & 0x1:
defaults = state.pop()
res = state.make_temp()
state.append(
inst,
Expand Down
7 changes: 3 additions & 4 deletions numba/core/compiler.py
Original file line number Diff line number Diff line change
Expand Up @@ -669,10 +669,9 @@ def define_objectmode_pipeline(state, name='object'):
pm.add_pass(PreLowerStripPhis, "remove phis nodes")
pm.add_pass(IRProcessing, "processing IR")

if utils.PYVERSION >= (3, 7):
# The following passes are needed to adjust for looplifting
pm.add_pass(CanonicalizeLoopEntry, "canonicalize loop entry")
pm.add_pass(CanonicalizeLoopExit, "canonicalize loop exit")
# The following passes are needed to adjust for looplifting
pm.add_pass(CanonicalizeLoopEntry, "canonicalize loop entry")
pm.add_pass(CanonicalizeLoopExit, "canonicalize loop exit")

pm.add_pass(ObjectModeFrontEnd, "object mode frontend")
pm.add_pass(InlineClosureLikes,
Expand Down
Loading