diff --git a/loopy/compiled.py b/loopy/compiled.py
index e722fd3380b97691db0123c70f636153f37a5e5c..bda857b224eff646cc762420e1e8a33bee362f30 100644
--- a/loopy/compiled.py
+++ b/loopy/compiled.py
@@ -146,6 +146,9 @@ def generate_integer_arg_finding_from_shapes(gen, kernel, impl_arg_info, flags):
         if arg.arg_class is GlobalArg:
             sym_shape = var(arg.name).attr("shape")
             for axis_nr, shape_i in enumerate(arg.shape):
+                if shape_i is None:
+                    continue
+
                 deps = dep_map(shape_i)
 
                 if len(deps) == 1: