From 883b3ae0ca7bbf23773df0fcbbec2e954292c13e Mon Sep 17 00:00:00 2001 From: Konstantin Seurer Date: Wed, 4 Jan 2023 16:49:08 +0100 Subject: [PATCH] ac/llvm: Fix validation error with global io Fixes: afd645f0576 ("ac/llvm: remove LLVMBuildGEP usages") Reviewed-by: Pierre-Eric Pelloux-Prayer Reviewed-by: Samuel Pitoiset Part-of: (cherry picked from commit 10ac51a52bad2c2378b2d847eae23e1366ddc46f) --- .pick_status.json | 2 +- src/amd/llvm/ac_nir_to_llvm.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.pick_status.json b/.pick_status.json index a4a316c78ec..cef4e8f5c4d 100644 --- a/.pick_status.json +++ b/.pick_status.json @@ -499,7 +499,7 @@ "description": "ac/llvm: Fix validation error with global io", "nominated": true, "nomination_type": 1, - "resolution": 0, + "resolution": 1, "main_sha": null, "because_sha": "afd645f0576f2cf41b65f360787f01604f00f0f2" }, diff --git a/src/amd/llvm/ac_nir_to_llvm.c b/src/amd/llvm/ac_nir_to_llvm.c index 7856a7d7474..007652bde33 100644 --- a/src/amd/llvm/ac_nir_to_llvm.c +++ b/src/amd/llvm/ac_nir_to_llvm.c @@ -2147,7 +2147,7 @@ static LLVMValueRef get_global_address(struct ac_nir_context *ctx, LLVMTypeRef i8_ptr_type = LLVMPointerType(ctx->ac.i8, AC_ADDR_SPACE_GLOBAL); addr = LLVMBuildIntToPtr(ctx->ac.builder, addr, i8_ptr_type, ""); addr = LLVMBuildGEP2(ctx->ac.builder, ctx->ac.i8, addr, &offset, 1, ""); - return addr; + return LLVMBuildPointerCast(ctx->ac.builder, addr, ptr_type, ""); } else { return LLVMBuildIntToPtr(ctx->ac.builder, addr, ptr_type, ""); }