freedreno/ir3: add debug flag to disable cp
authorRob Clark <robclark@freedesktop.org>
Sun, 19 Oct 2014 18:55:32 +0000 (14:55 -0400)
committerRob Clark <robclark@freedesktop.org>
Tue, 21 Oct 2014 01:42:44 +0000 (21:42 -0400)
FD_MESA_DEBUG=nocp will disable copy propagation pass.

Signed-off-by: Rob Clark <robclark@freedesktop.org>
src/gallium/drivers/freedreno/freedreno_screen.c
src/gallium/drivers/freedreno/freedreno_util.h
src/gallium/drivers/freedreno/ir3/ir3_cmdline.c
src/gallium/drivers/freedreno/ir3/ir3_compiler.c

index bc6ff78aa734836f74f4d3cbc19f263a3c3352b2..ddc7302c5c819ebb106b7aafbf2d51e3fb171d6b 100644 (file)
@@ -70,6 +70,7 @@ static const struct debug_named_value debug_options[] = {
                {"optmsgs",   FD_DBG_OPTMSGS,"Enable optimizater debug messages"},
                {"optdump",   FD_DBG_OPTDUMP,"Dump shader DAG to .dot files"},
                {"glsl130",   FD_DBG_GLSL130,"Temporary flag to enable GLSL 130 on a3xx+"},
+               {"nocp",      FD_DBG_NOCP,   "Disable copy-propagation"},
                DEBUG_NAMED_VALUE_END
 };
 
index f1a1e6e7c550ee807a568c5734abe194384bf65b..36a5995c43ddff5833c4286746c7be0bd340fa14 100644 (file)
@@ -66,6 +66,7 @@ enum adreno_stencil_op fd_stencil_op(unsigned op);
 #define FD_DBG_OPTMSGS  0x0400
 #define FD_DBG_OPTDUMP  0x0800
 #define FD_DBG_GLSL130  0x1000
+#define FD_DBG_NOCP     0x2000
 
 extern int fd_mesa_debug;
 extern bool fd_binning_enabled;
index 86239b45465d83c2cbbf388c6192a501a96b77d2..652ec163f8032f15f3a77f531f41f2969e6d66dd 100644 (file)
@@ -133,6 +133,7 @@ static void print_usage(void)
        printf("    --saturate-s MASK - bitmask of samplers to saturate S coord\n");
        printf("    --saturate-t MASK - bitmask of samplers to saturate T coord\n");
        printf("    --saturate-r MASK - bitmask of samplers to saturate R coord\n");
+       printf("    --nocp            - disable copy propagation\n");
        printf("    --help            - show this message\n");
 }
 
@@ -199,6 +200,12 @@ int main(int argc, char **argv)
                        continue;
                }
 
+               if (!strcmp(argv[n], "--nocp")) {
+                       fd_mesa_debug |= FD_DBG_NOCP;
+                       n++;
+                       continue;
+               }
+
                if (!strcmp(argv[n], "--help")) {
                        print_usage();
                        return 0;
index dc4f985f4b7f5885325e7c6b0120b0a6c56bb9bd..233f1748b05ac03bcfa1f91e50379a29f3794b77 100644 (file)
@@ -3175,7 +3175,7 @@ ir3_compile_shader(struct ir3_shader_variant *so,
                ir3_dump_instr_list(block->head);
        }
 
-       if (cp)
+       if (cp && !(fd_mesa_debug & FD_DBG_NOCP))
                ir3_block_cp(block);
 
        if (fd_mesa_debug & FD_DBG_OPTDUMP)