From 4a80272baeaa27681904fe76db447b7a32e8f854 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marek=20Ol=C5=A1=C3=A1k?= Date: Tue, 18 Mar 2025 16:52:02 -0400 Subject: [PATCH] ac/llvm: fix readlane with vectors It crashes in LLVM when the type is not scalar integer. Reviewed-by: Pierre-Eric Pelloux-Prayer Reviewed-by: Rhys Perry Part-of: --- src/amd/llvm/ac_llvm_build.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/amd/llvm/ac_llvm_build.c b/src/amd/llvm/ac_llvm_build.c index a9ea8d85d00..4ccf1d88200 100644 --- a/src/amd/llvm/ac_llvm_build.c +++ b/src/amd/llvm/ac_llvm_build.c @@ -2569,7 +2569,7 @@ static LLVMValueRef ac_build_readlane_common(struct ac_llvm_context *ctx, LLVMVa { LLVMTypeRef src_type = LLVMTypeOf(src); src = ac_to_integer(ctx, src); - unsigned bits = LLVMGetIntTypeWidth(LLVMTypeOf(src)); + unsigned bits = ac_get_type_size(LLVMTypeOf(src)) * 8; LLVMValueRef ret; if (bits > 32) {