From f12adf2cc978586ccecbf323afc0bcbebaa94177 Mon Sep 17 00:00:00 2001 From: Pierre-Eric Pelloux-Prayer Date: Mon, 10 Oct 2022 12:28:49 +0200 Subject: [PATCH] ac/llvm: remove unneeded casts MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The only useful information in pointer types is the address space and these casts don't change it. The type information is explicitely passed by the caller of GEP2 and similar functions. Reviewed-by: Mihai Preda Reviewed-by: Dave Airlie Reviewed-by: Qiang Yu Reviewed-by: Marek Olšák Acked-by: Samuel Pitoiset Part-of: --- src/amd/llvm/ac_nir_to_llvm.c | 8 -------- 1 file changed, 8 deletions(-) diff --git a/src/amd/llvm/ac_nir_to_llvm.c b/src/amd/llvm/ac_nir_to_llvm.c index 9d3960495ee..5bf2bc3415f 100644 --- a/src/amd/llvm/ac_nir_to_llvm.c +++ b/src/amd/llvm/ac_nir_to_llvm.c @@ -3170,10 +3170,6 @@ static LLVMValueRef visit_var_atomic(struct ac_nir_context *ctx, const nir_intri src = ac_to_float(&ctx->ac, src); src_type = LLVMTypeOf(src); - LLVMTypeRef ptr_type = - LLVMPointerType(src_type, LLVMGetPointerAddressSpace(LLVMTypeOf(ptr))); - ptr = LLVMBuildBitCast(ctx->ac.builder, ptr, ptr_type, ""); - params[arg_count++] = ptr; params[arg_count++] = src; params[arg_count++] = ctx->ac.i32_0; @@ -3226,10 +3222,6 @@ static LLVMValueRef visit_var_atomic(struct ac_nir_context *ctx, const nir_intri if (instr->intrinsic == nir_intrinsic_shared_atomic_fadd) { val = ac_to_float(&ctx->ac, src); - - LLVMTypeRef ptr_type = - LLVMPointerType(LLVMTypeOf(val), LLVMGetPointerAddressSpace(LLVMTypeOf(ptr))); - ptr = LLVMBuildBitCast(ctx->ac.builder, ptr, ptr_type, ""); } else { val = ac_to_integer(&ctx->ac, src); }