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
6 changes: 3 additions & 3 deletions numba_cuda/numba/cuda/core/interpreter.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
UnsupportedBytecodeError,
error_extras,
)
from numba.core.ir_utils import get_definition, guard
from numba.cuda.core import ir_utils
from numba.core.utils import (
PYVERSION,
BINOPS_TO_OPERATORS,
Expand Down Expand Up @@ -1296,10 +1296,10 @@ def _build_new_build_map(func_ir, name, old_body, old_lineno, new_items):
values = []
for pair in new_items:
k, v = pair
key_def = guard(get_definition, func_ir, k)
key_def = ir_utils.guard(ir_utils.get_definition, func_ir, k)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm curious - do our tests all pass if we use

Suggested change
key_def = ir_utils.guard(ir_utils.get_definition, func_ir, k)
key_def = func_ir.get_definition(k)

here (and similar for value_def below) instead?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I will check!

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

(If not, perhaps we can still do the above suggestion and catch a KeyError rather than keeping get_definition and guard)

if isinstance(key_def, (ir.Const, ir.Global, ir.FreeVar)):
literal_keys.append(key_def.value)
value_def = guard(get_definition, func_ir, v)
value_def = ir_utils.guard(ir_utils.get_definition, func_ir, v)
if isinstance(value_def, (ir.Const, ir.Global, ir.FreeVar)):
values.append(value_def.value)
else:
Expand Down
Loading