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 <pendingchaos02@gmail.com>
Reviewed-by: Daniel Schürmann <daniel@schuermann.dev>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25559>
This commit is contained in:
Rhys Perry 2023-10-10 11:24:03 +01:00 committed by Marge Bot
parent d200916ca2
commit b18f0dec41

View file

@ -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);