Module: Mesa Branch: main Commit: b18f0dec419560a315719f9647db6eb29598c7e3 URL: http://cgit.freedesktop.org/mesa/mesa/commit/?id=b18f0dec419560a315719f9647db6eb29598c7e3
Author: Rhys Perry <pendingchao...@gmail.com> Date: Tue Oct 10 11:24:03 2023 +0100 aco: collect Pre-Sched SGPRs/VGPRs before spilling The usage after spilling is usually either the same as before or the maximum. Signed-off-by: Rhys Perry <pendingchao...@gmail.com> Reviewed-by: Daniel Schürmann <dan...@schuermann.dev> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25559> --- src/amd/compiler/aco_interface.cpp | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/src/amd/compiler/aco_interface.cpp b/src/amd/compiler/aco_interface.cpp index bdf74ca5dd1..757711aa0ad 100644 --- a/src/amd/compiler/aco_interface.cpp +++ b/src/amd/compiler/aco_interface.cpp @@ -146,6 +146,8 @@ aco_postprocess_shader(const struct aco_compiler_options* options, /* spilling and scheduling */ live_vars = aco::live_var_analysis(program.get()); + if (program->collect_statistics) + aco::collect_presched_stats(program.get()); aco::spill(program.get(), live_vars); } @@ -164,9 +166,6 @@ aco_postprocess_shader(const struct aco_compiler_options* options, free(data); } - if (program->collect_statistics) - aco::collect_presched_stats(program.get()); - if ((aco::debug_flags & aco::DEBUG_LIVE_INFO) && options->dump_shader) aco_print_program(program.get(), stderr, live_vars, aco::print_live_vars | aco::print_kill);