diff --git a/python/dune/perftool/pdelab/localoperator.py b/python/dune/perftool/pdelab/localoperator.py
index 85f1f0a26d44deb57c357f635a24ef6b8e8bc42a..9bd174b0f7abff14c71bdf2e0159a1e94544be21 100644
--- a/python/dune/perftool/pdelab/localoperator.py
+++ b/python/dune/perftool/pdelab/localoperator.py
@@ -287,12 +287,12 @@ def generate_kernel(integrals):
 
     # see whether we need iname duplication to make this thing schedulable!
     # TODO: Use a clever strategy here, instead of random transformation until the problem is resolved
-    from loopy import needs_iname_duplication, get_iname_duplication_options, duplicate_inames
-    while needs_iname_duplication(kernel):
+    from loopy import has_schedulable_iname_nesting, get_iname_duplication_options, duplicate_inames
+    while not has_schedulable_iname_nesting(kernel):
         # If there is a duplication that solves the problem with just one duplication, we pick that one
         iname, within = (None, None)
         for i, w in get_iname_duplication_options(kernel):
-            if not needs_iname_duplication(duplicate_inames(kernel, i, w)):
+            if has_schedulable_iname_nesting(duplicate_inames(kernel, i, w)):
                 iname, within = (i, w)
 
         # Otherwise pick a random one.