ac/llvm: remove unneeded casts

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 <mhpreda@gmail.com>
Reviewed-by: Dave Airlie <airlied@redhat.com>
Reviewed-by: Qiang Yu <yuq825@gmail.com>
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Acked-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19035>
This commit is contained in:
Pierre-Eric Pelloux-Prayer
2022-10-10 12:28:49 +02:00
committed by Marge Bot
parent a15eed1e22
commit f12adf2cc9
-8
View File
@@ -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);
}