ac/llvm: remove immoffset parameter from ac_build_tbuffer_store

Reviewed-by: Mihai Preda <mhpreda@gmail.com>
Reviewed-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15966>
This commit is contained in:
Marek Olšák
2022-04-15 00:05:33 -04:00
committed by Marge Bot
parent a3e777a89a
commit 6234d92073

View File

@@ -53,9 +53,8 @@ struct ac_llvm_flow {
static void ac_build_tbuffer_store(struct ac_llvm_context *ctx, LLVMValueRef rsrc, static void ac_build_tbuffer_store(struct ac_llvm_context *ctx, LLVMValueRef rsrc,
LLVMValueRef vdata, LLVMValueRef vindex, LLVMValueRef voffset, LLVMValueRef vdata, LLVMValueRef vindex, LLVMValueRef voffset,
LLVMValueRef soffset, LLVMValueRef immoffset, LLVMValueRef soffset, unsigned num_channels, unsigned dfmt,
unsigned num_channels, unsigned dfmt, unsigned nfmt, unsigned nfmt, unsigned cache_policy);
unsigned cache_policy);
/* Initialize module-independent parts of the context. /* Initialize module-independent parts of the context.
* *
@@ -1194,8 +1193,9 @@ void ac_build_buffer_store_dword(struct ac_llvm_context *ctx, LLVMValueRef rsrc,
unsigned dfmt = dfmts[num_channels - 1]; unsigned dfmt = dfmts[num_channels - 1];
unsigned nfmt = V_008F0C_BUF_NUM_FORMAT_UINT; unsigned nfmt = V_008F0C_BUF_NUM_FORMAT_UINT;
LLVMValueRef immoffset = LLVMConstInt(ctx->i32, inst_offset, 0); LLVMValueRef immoffset = LLVMConstInt(ctx->i32, inst_offset, 0);
voffset = LLVMBuildAdd(ctx->builder, voffset ? voffset : ctx->i32_0, immoffset, "");
ac_build_tbuffer_store(ctx, rsrc, vdata, vindex, voffset, soffset, immoffset, num_channels, dfmt, ac_build_tbuffer_store(ctx, rsrc, vdata, vindex, voffset, soffset, num_channels, dfmt,
nfmt, cache_policy); nfmt, cache_policy);
} }
@@ -1675,12 +1675,9 @@ LLVMValueRef ac_build_opencoded_load_format(struct ac_llvm_context *ctx, unsigne
static void ac_build_tbuffer_store(struct ac_llvm_context *ctx, LLVMValueRef rsrc, static void ac_build_tbuffer_store(struct ac_llvm_context *ctx, LLVMValueRef rsrc,
LLVMValueRef vdata, LLVMValueRef vindex, LLVMValueRef voffset, LLVMValueRef vdata, LLVMValueRef vindex, LLVMValueRef voffset,
LLVMValueRef soffset, LLVMValueRef immoffset, LLVMValueRef soffset, unsigned num_channels, unsigned dfmt,
unsigned num_channels, unsigned dfmt, unsigned nfmt, unsigned nfmt, unsigned cache_policy)
unsigned cache_policy)
{ {
voffset = LLVMBuildAdd(ctx->builder, voffset ? voffset : ctx->i32_0, immoffset, "");
LLVMValueRef args[7]; LLVMValueRef args[7];
int idx = 0; int idx = 0;
args[idx++] = vdata; args[idx++] = vdata;
@@ -1710,7 +1707,8 @@ void ac_build_struct_tbuffer_store(struct ac_llvm_context *ctx, LLVMValueRef rsr
unsigned num_channels, unsigned dfmt, unsigned nfmt, unsigned num_channels, unsigned dfmt, unsigned nfmt,
unsigned cache_policy) unsigned cache_policy)
{ {
ac_build_tbuffer_store(ctx, rsrc, vdata, vindex, voffset, soffset, immoffset, num_channels, dfmt, voffset = LLVMBuildAdd(ctx->builder, voffset ? voffset : ctx->i32_0, immoffset, "");
ac_build_tbuffer_store(ctx, rsrc, vdata, vindex, voffset, soffset, num_channels, dfmt,
nfmt, cache_policy); nfmt, cache_policy);
} }
@@ -1719,7 +1717,8 @@ void ac_build_raw_tbuffer_store(struct ac_llvm_context *ctx, LLVMValueRef rsrc,
unsigned num_channels, unsigned dfmt, unsigned nfmt, unsigned num_channels, unsigned dfmt, unsigned nfmt,
unsigned cache_policy) unsigned cache_policy)
{ {
ac_build_tbuffer_store(ctx, rsrc, vdata, NULL, voffset, soffset, immoffset, num_channels, dfmt, voffset = LLVMBuildAdd(ctx->builder, voffset ? voffset : ctx->i32_0, immoffset, "");
ac_build_tbuffer_store(ctx, rsrc, vdata, NULL, voffset, soffset, num_channels, dfmt,
nfmt, cache_policy); nfmt, cache_policy);
} }