Module: Mesa
Branch: staging/22.3
Commit: 7eb73c369cf342551f86c74d9756f7ff2e4464aa
URL:    
http://cgit.freedesktop.org/mesa/mesa/commit/?id=7eb73c369cf342551f86c74d9756f7ff2e4464aa

Author: Konstantin Seurer <[email protected]>
Date:   Wed Jan  4 16:49:08 2023 +0100

ac/llvm: Fix validation error with global io

Fixes: afd645f0576 ("ac/llvm: remove LLVMBuildGEP usages")
Reviewed-by: Pierre-Eric Pelloux-Prayer <[email protected]>
Reviewed-by: Samuel Pitoiset <[email protected]>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20521>
(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 d40e4c34621..c841e61a2d4 100644
--- a/.pick_status.json
+++ b/.pick_status.json
@@ -661,7 +661,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 feda6aa0c92..98c99d0020e 100644
--- a/src/amd/llvm/ac_nir_to_llvm.c
+++ b/src/amd/llvm/ac_nir_to_llvm.c
@@ -2163,7 +2163,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, "");
    }

Reply via email to