amd,radeonsi: remove unused LLVM functions

Reviewed-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21525>
This commit is contained in:
Marek Olšák
2023-02-18 09:58:50 -05:00
committed by Marge Bot
parent d8b17b1752
commit 091268944d
7 changed files with 5 additions and 140 deletions

View File

@@ -2353,12 +2353,6 @@ static LLVMValueRef visit_load_ubo_buffer(struct ac_nir_context *ctx, nir_intrin
return exit_waterfall(ctx, &wctx, ret);
}
static unsigned type_scalar_size_bytes(const struct glsl_type *type)
{
assert(glsl_type_is_vector_or_scalar(type) || glsl_type_is_matrix(type));
return glsl_type_is_boolean(type) ? 4 : glsl_get_bit_size(type) / 8;
}
static void visit_store_output(struct ac_nir_context *ctx, nir_intrinsic_instr *instr)
{
if (ctx->ac.postponed_kill) {
@@ -4335,13 +4329,6 @@ static bool visit_intrinsic(struct ac_nir_context *ctx, nir_intrinsic_instr *ins
return true;
}
static LLVMValueRef get_sampler_desc(struct ac_nir_context *ctx,
enum ac_descriptor_type desc_type, const nir_instr *instr,
LLVMValueRef index, bool image, bool write)
{
return ctx->abi->load_sampler_desc(ctx->abi, index, desc_type);
}
/* Disable anisotropic filtering if BASE_LEVEL == LAST_LEVEL.
*
* GFX6-GFX7:
@@ -4831,66 +4818,6 @@ static bool visit_jump(struct ac_llvm_context *ctx, const nir_jump_instr *instr)
return true;
}
static LLVMTypeRef glsl_base_to_llvm_type(struct ac_llvm_context *ac, enum glsl_base_type type)
{
switch (type) {
case GLSL_TYPE_INT:
case GLSL_TYPE_UINT:
case GLSL_TYPE_BOOL:
case GLSL_TYPE_SUBROUTINE:
return ac->i32;
case GLSL_TYPE_INT8:
case GLSL_TYPE_UINT8:
return ac->i8;
case GLSL_TYPE_INT16:
case GLSL_TYPE_UINT16:
return ac->i16;
case GLSL_TYPE_FLOAT:
return ac->f32;
case GLSL_TYPE_FLOAT16:
return ac->f16;
case GLSL_TYPE_INT64:
case GLSL_TYPE_UINT64:
return ac->i64;
case GLSL_TYPE_DOUBLE:
return ac->f64;
default:
unreachable("unknown GLSL type");
}
}
static LLVMTypeRef glsl_to_llvm_type(struct ac_llvm_context *ac, const struct glsl_type *type)
{
if (glsl_type_is_scalar(type)) {
return glsl_base_to_llvm_type(ac, glsl_get_base_type(type));
}
if (glsl_type_is_vector(type)) {
return LLVMVectorType(glsl_base_to_llvm_type(ac, glsl_get_base_type(type)),
glsl_get_vector_elements(type));
}
if (glsl_type_is_matrix(type)) {
return LLVMArrayType(glsl_to_llvm_type(ac, glsl_get_column_type(type)),
glsl_get_matrix_columns(type));
}
if (glsl_type_is_array(type)) {
return LLVMArrayType(glsl_to_llvm_type(ac, glsl_get_array_element(type)),
glsl_get_length(type));
}
assert(glsl_type_is_struct_or_ifc(type));
LLVMTypeRef *const member_types = alloca(glsl_get_length(type) * sizeof(LLVMTypeRef));
for (unsigned i = 0; i < glsl_get_length(type); i++) {
member_types[i] = glsl_to_llvm_type(ac, glsl_get_struct_field(type, i));
}
return LLVMStructTypeInContext(ac->context, member_types, glsl_get_length(type), false);
}
static bool visit_cf_list(struct ac_nir_context *ctx, struct exec_list *list);
static bool visit_block(struct ac_nir_context *ctx, nir_block *block)

View File

@@ -26,34 +26,6 @@
#include "si_shader_internal.h"
#include "util/u_prim.h"
static LLVMValueRef get_wave_id_in_tg(struct si_shader_context *ctx)
{
return si_unpack_param(ctx, ctx->args->ac.merged_wave_info, 24, 4);
}
LLVMValueRef gfx10_get_thread_id_in_tg(struct si_shader_context *ctx)
{
LLVMBuilderRef builder = ctx->ac.builder;
LLVMValueRef tmp;
tmp = LLVMBuildMul(builder, get_wave_id_in_tg(ctx),
LLVMConstInt(ctx->ac.i32, ctx->ac.wave_size, false), "");
return LLVMBuildAdd(builder, tmp, ac_get_thread_id(&ctx->ac), "");
}
static LLVMValueRef ngg_get_query_buf(struct si_shader_context *ctx)
{
return ac_build_load_to_sgpr(&ctx->ac,
ac_get_ptr_arg(&ctx->ac, &ctx->args->ac, ctx->args->internal_bindings),
LLVMConstInt(ctx->ac.i32, SI_GS_QUERY_BUF, false));
}
static LLVMValueRef ngg_get_emulated_counters_buf(struct si_shader_context *ctx)
{
return ac_build_load_to_sgpr(&ctx->ac,
ac_get_ptr_arg(&ctx->ac, &ctx->args->ac, ctx->args->internal_bindings),
LLVMConstInt(ctx->ac.i32, SI_GS_QUERY_EMULATED_COUNTERS_BUF, false));
}
unsigned gfx10_ngg_get_vertices_per_prim(struct si_shader *shader)
{
const struct si_shader_info *info = &shader->selector->info;

View File

@@ -42,6 +42,7 @@ static const char scratch_rsrc_dword0_symbol[] = "SCRATCH_RSRC_DWORD0";
static const char scratch_rsrc_dword1_symbol[] = "SCRATCH_RSRC_DWORD1";
static void si_dump_shader_key(const struct si_shader *shader, FILE *f);
static void si_fix_resource_usage(struct si_screen *sscreen, struct si_shader *shader);
/* Get the number of all interpolated inputs */
unsigned si_get_ps_num_interp(struct si_shader *ps)
@@ -2781,7 +2782,7 @@ void si_multiwave_lds_size_workaround(struct si_screen *sscreen, unsigned *lds_s
*lds_size = MAX2(*lds_size, 8);
}
void si_fix_resource_usage(struct si_screen *sscreen, struct si_shader *shader)
static void si_fix_resource_usage(struct si_screen *sscreen, struct si_shader *shader)
{
unsigned min_sgprs = shader->info.num_input_sgprs + 2; /* VCC */

View File

@@ -171,10 +171,8 @@ bool si_need_ps_prolog(const union si_shader_part_key *key);
void si_get_ps_prolog_key(struct si_shader *shader, union si_shader_part_key *key,
bool separate_prolog);
void si_get_ps_epilog_key(struct si_shader *shader, union si_shader_part_key *key);
void si_fix_resource_usage(struct si_screen *sscreen, struct si_shader *shader);
/* gfx10_shader_ngg.c */
LLVMValueRef gfx10_get_thread_id_in_tg(struct si_shader_context *ctx);
unsigned gfx10_ngg_get_vertices_per_prim(struct si_shader *shader);
bool gfx10_ngg_export_prim_early(struct si_shader *shader);
unsigned gfx10_ngg_get_scratch_dw_size(struct si_shader *shader);
@@ -213,14 +211,11 @@ LLVMValueRef si_prolog_get_internal_bindings(struct si_shader_context *ctx);
void si_llvm_declare_esgs_ring(struct si_shader_context *ctx);
LLVMValueRef si_unpack_param(struct si_shader_context *ctx, struct ac_arg param, unsigned rshift,
unsigned bitwidth);
LLVMValueRef si_get_primitive_id(struct si_shader_context *ctx, unsigned swizzle);
void si_build_wrapper_function(struct si_shader_context *ctx, struct ac_llvm_pointer *parts,
unsigned num_parts, unsigned main_part,
unsigned next_shader_first_part,
enum ac_arg_type *main_arg_types,
bool same_thread_count);
bool si_llvm_translate_nir(struct si_shader_context *ctx, struct si_shader *shader,
struct nir_shader *nir, bool free_nir);
bool si_llvm_compile_shader(struct si_screen *sscreen, struct ac_llvm_compiler *compiler,
struct si_shader *shader, struct si_shader_args *args,
struct util_debug_callback *debug, struct nir_shader *nir);
@@ -244,7 +239,6 @@ void si_llvm_tcs_build_end(struct si_shader_context *ctx);
void si_llvm_init_tcs_callbacks(struct si_shader_context *ctx);
/* si_shader_llvm_ps.c */
LLVMValueRef si_get_sample_id(struct si_shader_context *ctx);
void si_llvm_build_ps_prolog(struct si_shader_context *ctx, union si_shader_part_key *key,
bool separate_prolog);
void si_llvm_build_ps_epilog(struct si_shader_context *ctx, union si_shader_part_key *key,

View File

@@ -379,28 +379,6 @@ LLVMValueRef si_unpack_param(struct si_shader_context *ctx, struct ac_arg param,
return unpack_llvm_param(ctx, value, rshift, bitwidth);
}
LLVMValueRef si_get_primitive_id(struct si_shader_context *ctx, unsigned swizzle)
{
if (swizzle > 0)
return ctx->ac.i32_0;
switch (ctx->stage) {
case MESA_SHADER_VERTEX:
return ac_get_arg(&ctx->ac, ctx->args->ac.vs_prim_id);
case MESA_SHADER_TESS_CTRL:
return ac_get_arg(&ctx->ac, ctx->args->ac.tcs_patch_id);
case MESA_SHADER_TESS_EVAL:
return ctx->abi.tes_patch_id_replaced ?
ctx->abi.tes_patch_id_replaced :
ac_get_arg(&ctx->ac, ctx->args->ac.tes_patch_id);
case MESA_SHADER_GEOMETRY:
return ac_get_arg(&ctx->ac, ctx->args->ac.gs_prim_id);
default:
assert(0);
return ctx->ac.i32_0;
}
}
static void si_llvm_declare_compute_memory(struct si_shader_context *ctx)
{
struct si_shader_selector *sel = ctx->shader->selector;
@@ -774,8 +752,8 @@ static LLVMValueRef si_llvm_load_sampler_desc(struct ac_shader_abi *abi, LLVMVal
return index;
}
bool si_llvm_translate_nir(struct si_shader_context *ctx, struct si_shader *shader,
struct nir_shader *nir, bool free_nir)
static bool si_llvm_translate_nir(struct si_shader_context *ctx, struct si_shader *shader,
struct nir_shader *nir, bool free_nir)
{
struct si_shader_selector *sel = shader->selector;
const struct si_shader_info *info = &sel->info;

View File

@@ -96,13 +96,6 @@ static LLVMValueRef si_get_gs_wave_id(struct si_shader_context *ctx)
return ac_get_arg(&ctx->ac, ctx->args->ac.gs_wave_id);
}
static LLVMValueRef ngg_get_emulated_counters_buf(struct si_shader_context *ctx)
{
return ac_build_load_to_sgpr(&ctx->ac,
ac_get_ptr_arg(&ctx->ac, &ctx->args->ac, ctx->args->internal_bindings),
LLVMConstInt(ctx->ac.i32, SI_GS_QUERY_EMULATED_COUNTERS_BUF, false));
}
void si_llvm_gs_build_end(struct si_shader_context *ctx)
{
if (ctx->screen->info.gfx_level >= GFX10)

View File

@@ -26,7 +26,7 @@
#include "si_shader_internal.h"
#include "sid.h"
LLVMValueRef si_get_sample_id(struct si_shader_context *ctx)
static LLVMValueRef si_get_sample_id(struct si_shader_context *ctx)
{
return si_unpack_param(ctx, ctx->args->ac.ancillary, 8, 4);
}