From 6f532aa30475b6bf664c6433fb45290c6ec54280 Mon Sep 17 00:00:00 2001
From: Andreas Kloeckner <inform@tiker.net>
Date: Sun, 23 Sep 2012 15:58:57 -0500
Subject: [PATCH] Another fix to in-footprint detection.

---
 loopy/cse.py | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/loopy/cse.py b/loopy/cse.py
index c468c7f9d..71b7b3c46 100644
--- a/loopy/cse.py
+++ b/loopy/cse.py
@@ -150,7 +150,6 @@ def build_global_storage_to_sweep_map(kernel, invocation_descriptors,
         global_stor2sweep = isl.Map.from_basic_map(stor2sweep)
     global_stor2sweep = global_stor2sweep.intersect_range(domain_dup_sweep)
 
-
     # {{{ check if non-footprint-building invocation descriptors fall into footprint
 
     # Make all inames except the sweep parameters. (The footprint may depend on those.)
@@ -203,7 +202,8 @@ def build_global_storage_to_sweep_map(kernel, invocation_descriptors,
             aligned_g_s2s_parm_dom = aligned_g_s2s_parm_dom.project_out_except(
                     arg_inames, [dim_type.param])
 
-            is_in_footprint = s2s_domain.is_subset(aligned_g_s2s_parm_dom)
+            is_in_footprint = ((s2s_domain & aligned_g_s2s_parm_dom)
+                    .is_subset(aligned_g_s2s_parm_dom))
 
             invdesc.is_in_footprint = is_in_footprint
 
-- 
GitLab