From 5f33f80dc707f4f0d12cd5993999a6de7f0da632 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marek=20Ol=C5=A1=C3=A1k?= Date: Sat, 8 May 2021 05:26:04 -0400 Subject: [PATCH] ac/llvm: expose set_range_metadata to more users MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit I sometimes use it for experiments. It will be used later. Reviewed-by: Timur Kristóf Part-of: --- src/amd/llvm/ac_llvm_build.c | 6 +++--- src/amd/llvm/ac_llvm_build.h | 2 ++ 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/src/amd/llvm/ac_llvm_build.c b/src/amd/llvm/ac_llvm_build.c index a65da8e9eff..cd95eba8ae3 100644 --- a/src/amd/llvm/ac_llvm_build.c +++ b/src/amd/llvm/ac_llvm_build.c @@ -1728,8 +1728,8 @@ void ac_build_tbuffer_store_byte(struct ac_llvm_context *ctx, LLVMValueRef rsrc, * \p lo is the minimum value inclusive. * \p hi is the maximum value exclusive. */ -static void set_range_metadata(struct ac_llvm_context *ctx, LLVMValueRef value, unsigned lo, - unsigned hi) +void ac_set_range_metadata(struct ac_llvm_context *ctx, LLVMValueRef value, unsigned lo, + unsigned hi) { LLVMValueRef range_md, md_args[2]; LLVMTypeRef type = LLVMTypeOf(value); @@ -1757,7 +1757,7 @@ LLVMValueRef ac_get_thread_id(struct ac_llvm_context *ctx) tid = ac_build_intrinsic(ctx, "llvm.amdgcn.mbcnt.hi", ctx->i32, tid_args, 2, AC_FUNC_ATTR_READNONE); } - set_range_metadata(ctx, tid, 0, ctx->wave_size); + ac_set_range_metadata(ctx, tid, 0, ctx->wave_size); return tid; } diff --git a/src/amd/llvm/ac_llvm_build.h b/src/amd/llvm/ac_llvm_build.h index 200974bf2e9..944cae6d70e 100644 --- a/src/amd/llvm/ac_llvm_build.h +++ b/src/amd/llvm/ac_llvm_build.h @@ -315,6 +315,8 @@ void ac_build_raw_tbuffer_store(struct ac_llvm_context *ctx, LLVMValueRef rsrc, unsigned num_channels, unsigned dfmt, unsigned nfmt, unsigned cache_policy); +void ac_set_range_metadata(struct ac_llvm_context *ctx, LLVMValueRef value, unsigned lo, + unsigned hi); LLVMValueRef ac_get_thread_id(struct ac_llvm_context *ctx); #define AC_TID_MASK_TOP_LEFT 0xfffffffc