From a377d0383d92a54d5e192712fb4c0ea625e48818 Mon Sep 17 00:00:00 2001 From: Andreas Kloeckner Date: Sat, 26 Nov 2016 19:19:54 -0600 Subject: [PATCH] Only consider predicates with usable inames in predicate hoist selection --- loopy/codegen/control.py | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/loopy/codegen/control.py b/loopy/codegen/control.py index 6964b3444..e75a95dec 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. -- GitLab