Skip to content
Merged
Changes from 1 commit
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
Prev Previous commit
Next Next commit
Support tuples of integer literals in alias analysis.
  • Loading branch information
DrTodd13 committed Sep 17, 2021
commit 85e55483230376bd724d9ef7d4279bd72a135adf
12 changes: 12 additions & 0 deletions numba/parfors/array_analysis.py
Original file line number Diff line number Diff line change
Expand Up @@ -1331,6 +1331,11 @@ def _analyze_inst(self, label, scope, equiv_set, inst, redefined):
and isinstance(typ.dtype, types.Integer)
):
shape = inst.value
elif (
Comment thread
DrTodd13 marked this conversation as resolved.
Resolved
isinstance(typ, types.containers.Tuple)
and all([isinstance(x, (types.IntegerLiteral)) for x in typ.types])
):
shape = inst.value

if isinstance(shape, ir.Const):
if isinstance(shape.value, tuple):
Expand Down Expand Up @@ -1385,6 +1390,13 @@ def _analyze_inst(self, label, scope, equiv_set, inst, redefined):
shape = self._gen_shape_call(
equiv_set, lhs, len(typ), shape, post
)
elif (
Comment thread
DrTodd13 marked this conversation as resolved.
Resolved
isinstance(typ, types.containers.Tuple)
and all([isinstance(x, (types.IntegerLiteral)) for x in typ.types])
):
shape = self._gen_shape_call(
equiv_set, lhs, len(typ), shape, post
)

""" See the comment on the define() function.

Expand Down