Skip to content

Commit

Permalink
get rid of noop insns
Browse files Browse the repository at this point in the history
  • Loading branch information
kaushikcfd committed Jul 11, 2022
1 parent f69755d commit e72f316
Showing 1 changed file with 11 additions and 1 deletion.
12 changes: 11 additions & 1 deletion pyop2/global_kernel.py
Original file line number Diff line number Diff line change
Expand Up @@ -383,7 +383,6 @@ def code_to_compile(self):
"Vectorization strategy"
f" '{configuration['vectorization_strategy']}'")

print(wrapper)
code = lp.generate_code_v2(wrapper)

if self.local_kernel.cpp:
Expand Down Expand Up @@ -416,6 +415,17 @@ def vectorise(self, wrapper, iname, batch_size):

kernel = wrapper.default_entrypoint

# {{{ get rid of noop insns

from loopy.match import Id, Or

noop_insn_ids = [Id(insn.id)
for insn in kernel.instructions
if isinstance(insn, lp.NoOpInstruction)]
kernel = lp.remove_instructions(kernel, Or(tuple(noop_insn_ids)))

# }}}

# align temps
alignment = configuration["alignment"]
tmps = {name: tv.copy(alignment=alignment)
Expand Down

0 comments on commit e72f316

Please sign in to comment.