aco: add ACO_DEBUG=liveinfo
authorRhys Perry <pendingchaos02@gmail.com>
Mon, 15 Mar 2021 14:17:14 +0000 (14:17 +0000)
committerMarge Bot <eric+marge@anholt.net>
Fri, 19 Mar 2021 11:27:05 +0000 (11:27 +0000)
Signed-off-by: Rhys Perry <pendingchaos02@gmail.com>
Reviewed-by: Timur Kristóf <timur.kristof@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9599>

docs/envvars.rst
src/amd/compiler/aco_interface.cpp
src/amd/compiler/aco_ir.cpp
src/amd/compiler/aco_ir.h

index 0496c52..752cc58 100644 (file)
@@ -667,6 +667,8 @@ RADV driver environment variables
       disable instructions scheduling
    ``perfinfo``
       print information used to calculate some pipeline statistics
+   ``liveinfo``
+      print liveness and register demand information before scheduling
 
 radeonsi driver environment variables
 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
index 7b4a2f4..e3f1986 100644 (file)
@@ -131,6 +131,9 @@ void aco_compile_shader(unsigned shader_count,
    if (program->collect_statistics)
       aco::collect_presched_stats(program.get());
 
+   if ((aco::debug_flags & aco::DEBUG_LIVE_INFO) && args->options->dump_shader)
+      aco_print_program(program.get(), stderr, live_vars, aco::print_live_vars | aco::print_kill);
+
    if (!args->is_trap_handler_shader) {
       if (!args->options->disable_optimizations &&
           !(aco::debug_flags & aco::DEBUG_NO_SCHED))
index 6815b32..01de699 100644 (file)
@@ -39,6 +39,7 @@ static const struct debug_control aco_debug_options[] = {
    {"noopt", DEBUG_NO_OPT},
    {"nosched", DEBUG_NO_SCHED},
    {"perfinfo", DEBUG_PERF_INFO},
+   {"liveinfo", DEBUG_LIVE_INFO},
    {NULL, 0}
 };
 
index 8635c72..240f36c 100644 (file)
@@ -56,6 +56,7 @@ enum {
    DEBUG_NO_OPT = 0x20,
    DEBUG_NO_SCHED = 0x40,
    DEBUG_PERF_INFO = 0x80,
+   DEBUG_LIVE_INFO = 0x100,
 };
 
 /**