diff --git a/loopy/codegen/control.py b/loopy/codegen/control.py index 6964b344427ad8e7ca967f91715fe95f0bbf91da..e75a95dec781317389b06aeaf2fbdbcbcc7f7bf6 100644 --- a/loopy/codegen/control.py +++ b/loopy/codegen/control.py @@ -316,6 +316,8 @@ def build_loop_nest(codegen_state, schedule_index): recursive calls from doing anything about groups that are too small. """ + from loopy.symbolic import get_dependencies + # The rough plan here is that build_insn_group starts out with the # entirety of the current schedule item's downward siblings (i.e. all # the ones up to the next LeaveLoop). It will then iterate upward to @@ -363,6 +365,11 @@ def build_loop_nest(codegen_state, schedule_index): & sched_index_info_entries[candidate_group_length-1] .required_predicates) + current_pred_set = frozenset( + pred for pred in current_pred_set + if get_dependencies(pred) & kernel.all_inames() + <= current_iname_set) + # {{{ see which inames are actually used in group # And only generate conditionals for those.