broadcom/compiler: add V3D_DEBUG_NO_LOOP_UNROLL debug option
authorJuan A. Suarez Romero <jasuarez@igalia.com>
Fri, 10 Sep 2021 10:31:35 +0000 (12:31 +0200)
committerMarge Bot <eric+marge@anholt.net>
Mon, 13 Sep 2021 08:51:54 +0000 (08:51 +0000)
Disables loop unrolling.

Reviewed-by: Iago Toral Quiroga <itoral@igalia.com>
Signed-off-by: Juan A. Suarez Romero <jasuarez@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/12803>

src/broadcom/common/v3d_debug.c
src/broadcom/common/v3d_debug.h
src/broadcom/compiler/vir.c

index 5352e3d..53e6bef 100644 (file)
@@ -84,6 +84,8 @@ static const struct debug_named_value debug_control[] = {
          */
         { "tmu16",  V3D_DEBUG_TMU_16BIT,
           "Force 16-bit precision on all TMU operations" },
+        { "noloopunroll",  V3D_DEBUG_NO_LOOP_UNROLL,
+          "Disable loop unrolling" },
         { NULL }
 };
 
index 21ae4ce..06d8f0f 100644 (file)
@@ -61,6 +61,7 @@ extern uint32_t V3D_DEBUG;
 #define V3D_DEBUG_DUMP_SPIRV        (1 << 17)
 #define V3D_DEBUG_TMU_32BIT         (1 << 18)
 #define V3D_DEBUG_TMU_16BIT         (1 << 19)
+#define V3D_DEBUG_NO_LOOP_UNROLL    (1 << 20)
 
 #define V3D_DEBUG_SHADERS           (V3D_DEBUG_TGSI | V3D_DEBUG_NIR | \
                                      V3D_DEBUG_VIR | V3D_DEBUG_QPU | \
index ffde36b..27869a3 100644 (file)
@@ -563,7 +563,8 @@ vir_compile_init(const struct v3d_compiler *compiler,
         c->fallback_scheduler = fallback_scheduler;
         c->disable_tmu_pipelining = disable_tmu_pipelining;
         c->disable_constant_ubo_load_sorting = disable_constant_ubo_load_sorting;
-        c->disable_loop_unrolling = disable_loop_unrolling;
+        c->disable_loop_unrolling = V3D_DEBUG & V3D_DEBUG_NO_LOOP_UNROLL
+                ? true : disable_loop_unrolling;
 
         s = nir_shader_clone(c, s);
         c->s = s;