Mesa (master): radeonsi: assume that constant load_local_group_size has been optimized out

GitLab Mirror gitlab-mirror at kemper.freedesktop.org
Fri Sep 25 09:15:33 UTC 2020


Module: Mesa
Branch: master
Commit: 16afaf03555c06e1d0eb54ea4326c62745ccf90f
URL:    http://cgit.freedesktop.org/mesa/mesa/commit/?id=16afaf03555c06e1d0eb54ea4326c62745ccf90f

Author: Marek Olšák <marek.olsak at amd.com>
Date:   Fri Sep 18 02:21:26 2020 -0400

radeonsi: assume that constant load_local_group_size has been optimized out

Acked-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer at amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/6782>

---

 src/gallium/drivers/radeonsi/si_shader_llvm.c | 18 ++----------------
 src/gallium/drivers/radeonsi/si_shader_nir.c  |  3 +--
 2 files changed, 3 insertions(+), 18 deletions(-)

diff --git a/src/gallium/drivers/radeonsi/si_shader_llvm.c b/src/gallium/drivers/radeonsi/si_shader_llvm.c
index 014e8a1d4b3..f3ffee660f8 100644
--- a/src/gallium/drivers/radeonsi/si_shader_llvm.c
+++ b/src/gallium/drivers/radeonsi/si_shader_llvm.c
@@ -356,22 +356,8 @@ LLVMValueRef si_llvm_get_block_size(struct ac_shader_abi *abi)
 {
    struct si_shader_context *ctx = si_shader_context_from_abi(abi);
 
-   LLVMValueRef values[3];
-   LLVMValueRef result;
-   unsigned i;
-
-   if (!ctx->shader->selector->info.base.cs.local_size_variable) {
-      uint16_t *local_size = ctx->shader->selector->info.base.cs.local_size;
-
-      for (i = 0; i < 3; ++i)
-         values[i] = LLVMConstInt(ctx->ac.i32, local_size[i], 0);
-
-      result = ac_build_gather_values(&ctx->ac, values, 3);
-   } else {
-      result = ac_get_arg(&ctx->ac, ctx->block_size);
-   }
-
-   return result;
+   assert(ctx->shader->selector->info.base.cs.local_size_variable);
+   return ac_get_arg(&ctx->ac, ctx->block_size);
 }
 
 void si_llvm_declare_compute_memory(struct si_shader_context *ctx)
diff --git a/src/gallium/drivers/radeonsi/si_shader_nir.c b/src/gallium/drivers/radeonsi/si_shader_nir.c
index b39b6432d83..44b1a71a9e7 100644
--- a/src/gallium/drivers/radeonsi/si_shader_nir.c
+++ b/src/gallium/drivers/radeonsi/si_shader_nir.c
@@ -352,8 +352,7 @@ void si_nir_scan_shader(const struct nir_shader *nir, struct si_shader_info *inf
    info->uses_subgroup_info = nir->info.system_values_read & BITFIELD64_BIT(SYSTEM_VALUE_LOCAL_INVOCATION_INDEX) ||
                               nir->info.system_values_read & BITFIELD64_BIT(SYSTEM_VALUE_SUBGROUP_ID) ||
                               nir->info.system_values_read & BITFIELD64_BIT(SYSTEM_VALUE_NUM_SUBGROUPS);
-   info->uses_variable_block_size = info->base.cs.local_size_variable &&
-                                    nir->info.system_values_read & BITFIELD64_BIT(SYSTEM_VALUE_LOCAL_GROUP_SIZE);
+   info->uses_variable_block_size = nir->info.system_values_read & BITFIELD64_BIT(SYSTEM_VALUE_LOCAL_GROUP_SIZE);
    info->uses_drawid = nir->info.system_values_read & BITFIELD64_BIT(SYSTEM_VALUE_DRAW_ID);
    info->uses_primid = nir->info.system_values_read & BITFIELD64_BIT(SYSTEM_VALUE_PRIMITIVE_ID) ||
                        nir->info.inputs_read & VARYING_BIT_PRIMITIVE_ID;



More information about the mesa-commit mailing list