Skip to content

Commit 10ae7b8

Browse files
author
Diptorup Deb
authored
Merge pull request #1163 from IntelPython/fix/coverity_issues_0.21.3_gold
[gold/2021] Remove dead code to silence coverity errors.
2 parents 5aaf492 + b2758b8 commit 10ae7b8

File tree

3 files changed

+1
-66
lines changed

3 files changed

+1
-66
lines changed

numba_dpex/core/passes/dufunc_inliner.py

Lines changed: 0 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -116,13 +116,8 @@ def _is_dufunc_callsite(expr, block):
116116

117117

118118
def dufunc_inliner(func_ir, calltypes, typemap, typingctx, targetctx):
119-
_DEBUG = False
120119
modified = False
121120

122-
if _DEBUG:
123-
print("GUFunc before inlining DUFunc".center(80, "-"))
124-
print(func_ir.dump())
125-
126121
work_list = list(func_ir.blocks.items())
127122
# use a work list, look for call sites via `ir.Expr.op == call` and
128123
# then pass these to `self._do_work` to make decisions about inlining.
@@ -152,11 +147,6 @@ def dufunc_inliner(func_ir, calltypes, typemap, typingctx, targetctx):
152147
break # because block structure changed
153148
else:
154149
continue
155-
if _DEBUG:
156-
print("GUFunc after inlining DUFunc".center(80, "-"))
157-
print(func_ir.dump())
158-
print("".center(80, "-"))
159-
160150
if modified:
161151
# clean up leftover load instructions. This step is needed or else
162152
# SpirvLowerer would complain
@@ -165,9 +155,4 @@ def dufunc_inliner(func_ir, calltypes, typemap, typingctx, targetctx):
165155
# functions introducing blocks
166156
func_ir.blocks = simplify_CFG(func_ir.blocks)
167157

168-
if _DEBUG:
169-
print("GUFunc after inlining DUFunc, DCE, SimplyCFG".center(80, "-"))
170-
print(func_ir.dump())
171-
print("".center(80, "-"))
172-
173158
return True

numba_dpex/core/passes/passes.py

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -31,15 +31,6 @@ def run_pass(self, state):
3131
assert state.func_ir
3232
func_ir = state.func_ir
3333

34-
_DEBUG = False
35-
36-
if _DEBUG:
37-
print(
38-
"Checks if size of OpenCL local address space alloca is a "
39-
+ "compile-time constant.".center(80, "-")
40-
)
41-
print(func_ir.dump())
42-
4334
work_list = list(func_ir.blocks.items())
4435
while work_list:
4536
label, block = work_list.pop()

numba_dpex/core/types/dpnp_ndarray_type.py

Lines changed: 1 addition & 42 deletions
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@ def __array_ufunc__(self, ufunc, method, *inputs, **kwargs):
5959
return
6060

6161
def __str__(self):
62-
return self.name.replace("USMNdArray", "DpnpNdarray")
62+
return self.name.replace("USMNdArray", "DpnpNdArray")
6363

6464
def __repr__(self):
6565
return self.__str__()
@@ -193,47 +193,6 @@ def __allocate__(
193193
# enable this code path.
194194
raise NotImplementedError("F Arrays are not yet supported")
195195

196-
empty_c_typ = lhs_typ.copy(layout="C")
197-
empty_c_var = ir.Var(scope, mk_unique_var("$empty_c_var"), loc)
198-
if typemap:
199-
typemap[empty_c_var.name] = lhs_typ.copy(layout="C")
200-
empty_c_assign = ir.Assign(alloc_call, empty_c_var, loc)
201-
202-
# attr call: asfortranarray = getattr(g_np_var, asfortranarray)
203-
asfortranarray_attr_call = ir.Expr.getattr(
204-
g_np_var, "asfortranarray", loc
205-
)
206-
afa_attr_var = ir.Var(
207-
scope, mk_unique_var("$asfortran_array_attr"), loc
208-
)
209-
if typemap:
210-
typemap[afa_attr_var.name] = get_np_ufunc_typ(
211-
dpnp.asfortranarray
212-
)
213-
afa_attr_assign = ir.Assign(
214-
asfortranarray_attr_call, afa_attr_var, loc
215-
)
216-
# call asfortranarray
217-
asfortranarray_call = ir.Expr.call(
218-
afa_attr_var, [empty_c_var], (), loc
219-
)
220-
if calltypes:
221-
calltypes[asfortranarray_call] = typemap[
222-
afa_attr_var.name
223-
].get_call_type(typingctx, [empty_c_typ], {})
224-
225-
asfortranarray_assign = ir.Assign(asfortranarray_call, lhs, loc)
226-
227-
out.extend(
228-
[
229-
g_np_assign,
230-
attr_assign,
231-
typ_var_assign,
232-
empty_c_assign,
233-
afa_attr_assign,
234-
asfortranarray_assign,
235-
]
236-
)
237196
else:
238197
alloc_assign = ir.Assign(alloc_call, lhs, loc)
239198
out.extend([g_np_assign, attr_assign, typ_var_assign, alloc_assign])

0 commit comments

Comments
 (0)