diff --git a/loopy/schedule.py b/loopy/schedule.py
index ed04bb32f185eaef5da702aaee9df49e4cd885bd..55a1c6aabe5baff6db52cee2ad748e693000189f 100644
--- a/loopy/schedule.py
+++ b/loopy/schedule.py
@@ -552,6 +552,11 @@ def generate_loop_schedules_internal(
                     allow_insn=True):
                 yield sub_sched
 
+            if not sched_state.group_insn_counts:
+                # No groups: We won't need to backtrack on scheduling
+                # instructions.
+                return
+
     # }}}
 
     # {{{ see if we're ready to leave the innermost loop