radv: remove set but never used num_preserved_sgprs
authorSamuel Pitoiset <samuel.pitoiset@gmail.com>
Fri, 10 Mar 2023 13:26:00 +0000 (14:26 +0100)
committerMarge Bot <emma+marge@anholt.net>
Tue, 21 Mar 2023 13:53:58 +0000 (13:53 +0000)
Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21897>

src/amd/compiler/aco_instruction_selection.cpp
src/amd/compiler/aco_interface.cpp
src/amd/compiler/aco_interface.h
src/amd/compiler/aco_ir.h
src/amd/vulkan/radv_shader.c
src/amd/vulkan/radv_shader.h

index 4b375d8..74d4cb9 100644 (file)
@@ -11898,13 +11898,12 @@ select_rt_prolog(Program* program, ac_shader_config* config,
 void
 select_vs_prolog(Program* program, const struct aco_vs_prolog_info* pinfo, ac_shader_config* config,
                  const struct aco_compiler_options* options, const struct aco_shader_info* info,
-                 const struct ac_shader_args* args, unsigned* num_preserved_sgprs)
+                 const struct ac_shader_args* args)
 {
    assert(pinfo->num_attributes > 0);
 
    /* This should be enough for any shader/stage. */
    unsigned max_user_sgprs = options->gfx_level >= GFX9 ? 32 : 16;
-   *num_preserved_sgprs = max_user_sgprs + 14;
 
    init_program(program, compute_cs, info, options->gfx_level, options->family, options->wgp_mode,
                 config);
@@ -11929,7 +11928,7 @@ select_vs_prolog(Program* program, const struct aco_vs_prolog_info* pinfo, ac_sh
    lgkm_imm.lgkm = 0;
 
    /* choose sgprs */
-   PhysReg vertex_buffers(align(*num_preserved_sgprs, 2));
+   PhysReg vertex_buffers(align(max_user_sgprs + 14, 2));
    PhysReg prolog_input = vertex_buffers.advance(8);
    PhysReg desc(
       align((has_nontrivial_divisors ? prolog_input : vertex_buffers).advance(8).reg(), 4));
index bb4f6e2..a8757a2 100644 (file)
@@ -312,8 +312,7 @@ aco_compile_vs_prolog(const struct aco_compiler_options* options,
    program->debug.private_data = NULL;
 
    /* create IR */
-   unsigned num_preserved_sgprs;
-   aco::select_vs_prolog(program.get(), pinfo, &config, options, info, args, &num_preserved_sgprs);
+   aco::select_vs_prolog(program.get(), pinfo, &config, options, info, args);
    aco::insert_NOPs(program.get());
 
    if (options->dump_shader)
@@ -333,7 +332,6 @@ aco_compile_vs_prolog(const struct aco_compiler_options* options,
    (*build_prolog)(binary,
                    config.num_sgprs,
                    config.num_vgprs,
-                   num_preserved_sgprs,
                    code.data(),
                    code.size(),
                    disasm.data(),
@@ -376,7 +374,6 @@ aco_compile_ps_epilog(const struct aco_compiler_options* options,
    (*build_epilog)(binary,
                    config.num_sgprs,
                    config.num_vgprs,
-                   0,
                    code.data(),
                    code.size(),
                    disasm.data(),
index 23d3525..a0c9e9a 100644 (file)
@@ -60,7 +60,6 @@ typedef void (aco_callback)(void **priv_ptr,
 typedef void (aco_shader_part_callback)(void **priv_ptr,
                                         uint32_t num_sgprs,
                                         uint32_t num_vgprs,
-                                        uint32_t num_preserved_sgprs,
                                         const uint32_t *code,
                                         uint32_t code_size,
                                         const char *disasm_str,
index 847c789..329a461 100644 (file)
@@ -2193,8 +2193,7 @@ void select_rt_prolog(Program* program, ac_shader_config* config,
                       const struct ac_shader_args* out_args);
 void select_vs_prolog(Program* program, const struct aco_vs_prolog_info* pinfo,
                       ac_shader_config* config, const struct aco_compiler_options* options,
-                      const struct aco_shader_info* info, const struct ac_shader_args* args,
-                      unsigned* num_preserved_sgprs);
+                      const struct aco_shader_info* info, const struct ac_shader_args* args);
 
 void select_ps_epilog(Program* program, const struct aco_ps_epilog_info* epilog_info,
                       ac_shader_config* config, const struct aco_compiler_options* options,
index 9c1e039..a1dafb1 100644 (file)
@@ -2502,7 +2502,6 @@ radv_shader_part_create(struct radv_shader_part_binary *binary, unsigned wave_si
    shader_part->code_size = code_size;
    shader_part->rsrc1 = S_00B848_VGPRS((binary->num_vgprs - 1) / (wave_size == 32 ? 8 : 4)) |
                         S_00B228_SGPRS((binary->num_sgprs - 1) / 8);
-   shader_part->num_preserved_sgprs = binary->num_preserved_sgprs;
    shader_part->disasm_string =
       binary->disasm_size ? strdup((const char *)(binary->data + binary->code_size)) : NULL;
 
@@ -2773,7 +2772,6 @@ radv_create_trap_handler_shader(struct radv_device *device)
 static void radv_aco_build_shader_part(void **bin,
                                        uint32_t num_sgprs,
                                        uint32_t num_vgprs,
-                                       uint32_t num_preserved_sgprs,
                                        const uint32_t *code,
                                        uint32_t code_size,
                                        const char *disasm_str,
@@ -2787,7 +2785,6 @@ static void radv_aco_build_shader_part(void **bin,
 
    part_binary->num_sgprs = num_sgprs;
    part_binary->num_vgprs = num_vgprs;
-   part_binary->num_preserved_sgprs = num_preserved_sgprs;
    part_binary->code_size = code_size * sizeof(uint32_t);
    memcpy(part_binary->data, code, part_binary->code_size);
    if (disasm_size) {
index afd4099..ca6c8d5 100644 (file)
@@ -460,7 +460,6 @@ struct radv_shader_binary_rtld {
 struct radv_shader_part_binary {
    uint8_t num_sgprs;
    uint8_t num_vgprs;
-   uint8_t num_preserved_sgprs;
    unsigned code_size;
    unsigned disasm_size;
    uint8_t data[0];
@@ -523,7 +522,6 @@ struct radv_shader_part {
    union radv_shader_arena_block *alloc;
    uint32_t code_size;
    uint32_t rsrc1;
-   uint8_t num_preserved_sgprs;
    bool nontrivial_divisors;
    uint32_t spi_shader_col_format;
    uint64_t upload_seq;