From 07fcb4aa199c69caea0458b41990a4cc965bcce2 Mon Sep 17 00:00:00 2001 From: Qiang Yu Date: Tue, 11 Jul 2023 18:08:19 +0800 Subject: [PATCH] radeonsi: remove param type check in wrapper function MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit Reviewed-by: Marek Olšák Signed-off-by: Qiang Yu Part-of: --- src/gallium/drivers/radeonsi/si_shader_llvm.c | 19 ++----------------- 1 file changed, 2 insertions(+), 17 deletions(-) diff --git a/src/gallium/drivers/radeonsi/si_shader_llvm.c b/src/gallium/drivers/radeonsi/si_shader_llvm.c index dd04b1a..75b4292 100644 --- a/src/gallium/drivers/radeonsi/si_shader_llvm.c +++ b/src/gallium/drivers/radeonsi/si_shader_llvm.c @@ -472,24 +472,9 @@ static void si_build_wrapper_function(struct si_shader_context *ctx, * tionally, so we can't consume it in the main * block. */ - unsigned num_part_params = LLVMCountParams(parts[1].value); - for (unsigned i = 0, j = 0; i < num_part_params; i++) { - LLVMValueRef param = LLVMGetParam(parts[1].value, i); - LLVMTypeRef type = LLVMTypeOf(param); - - bool found = false; - for ( ; j < num_params; j++) { - /* skip different type params */ - if (LLVMTypeOf(params[j]) == type) { - params[i] = params[j++]; - found = true; - break; - } - } - assert(found); - } - num_params = num_part_params; + /* Second part params are same as the preceeding params of the first part. */ + num_params = LLVMCountParams(parts[1].value); } ac_build_call(&ctx->ac, parts[1].pointee_type, parts[1].value, params, num_params); -- 2.7.4