Skip to content

Commit 714075a

Browse files
committed
PR cleanup
1 parent be5a4f9 commit 714075a

File tree

3 files changed

+8
-12
lines changed

3 files changed

+8
-12
lines changed

loki/transformations/hoist_variables.py

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -153,10 +153,6 @@ def transform_subroutine(self, routine, **kwargs):
153153
if not isinstance(child, ProcedureItem):
154154
continue
155155

156-
# skip successors that might have been inlined
157-
if not call_map.get(child.local_name, None):
158-
continue
159-
160156
arg_map = dict(call_map[child.local_name].arg_iter())
161157
hoist_variables = []
162158
for var in child.trafo_data[self._key]["hoist_variables"]:

loki/transformations/inline.py

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
from loki.batch import Transformation
1616
from loki.ir import (
1717
Import, Comment, Assignment, VariableDeclaration, CallStatement,
18-
Transformer, FindNodes, pragmas_attached, is_loki_pragma, Interface
18+
Transformer, FindNodes, pragmas_attached, is_loki_pragma
1919
)
2020
from loki.expression import (
2121
symbols as sym, FindVariables, FindInlineCalls, FindLiterals,
@@ -607,14 +607,14 @@ def inline_marked_subroutines(routine, allowed_aliases=None, adjust_imports=True
607607
import_map[impt] = impt.clone(symbols=new_symbols) if new_symbols else None
608608

609609
# Remove explicit interfaces of inlined routines
610-
for intf in FindNodes(Interface).visit(routine.ir):
610+
for intf in routine.interfaces:
611611
if not intf.spec:
612-
_body = []
613-
for s in intf.symbols:
614-
if s.name not in callees or s.name in not_inlined:
615-
_body += [s.type.dtype.procedure,]
612+
_body = tuple(
613+
s.type.dtype.procedure for s in intf.symbols
614+
if s.name not in callees or s.name in not_inlined
615+
)
616616
if _body:
617-
import_map[intf] = intf.clone(body=as_tuple(_body))
617+
import_map[intf] = intf.clone(body=_body)
618618
else:
619619
import_map[intf] = None
620620

loki/transformations/single_column/tests/test_single_column_coalesced.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1214,7 +1214,7 @@ def test_single_column_coalesced_hoist_nested_inline_openacc(frontend, horizonta
12141214
scc_hoist.apply(inner_kernel, role='kernel', item=inner_kernel_item)
12151215
scc_hoist.apply(
12161216
outer_kernel, role='kernel', item=outer_kernel_item,
1217-
targets=['compute_q'], successors=(inner_kernel_item,)
1217+
targets=['compute_q'], successors=()
12181218
)
12191219
scc_hoist.apply(
12201220
driver, role='driver', item=driver_item,

0 commit comments

Comments
 (0)