diff --git a/loopy/schedule.py b/loopy/schedule.py
index 8d77d2d914f8e2e84b89a5e2ad84dc9a64e84d95..f7eb17d4a2a59f5acef773cc313dda9332cde6d6 100644
--- a/loopy/schedule.py
+++ b/loopy/schedule.py
@@ -38,7 +38,7 @@ def realize_reduction(kernel):
 
         ilp_inames = [iname
                 for iname in insn.all_inames()
-                if isinstance(kernel.iname_to_tag[iname], IlpTag)]
+                if isinstance(kernel.iname_to_tag.get(iname), IlpTag)]
 
         from loopy.isl_helpers import static_max_of_pw_aff