radeonsi: rename num_memory_instructions -> num_memory_stores
authorMarek Olšák <marek.olsak@amd.com>
Sun, 6 Sep 2020 15:18:39 +0000 (11:18 -0400)
committerVivek Pandya <vivekvpandya@gmail.com>
Mon, 7 Sep 2020 15:55:17 +0000 (21:25 +0530)
it only counts stores

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

src/gallium/drivers/radeonsi/si_shader.c
src/gallium/drivers/radeonsi/si_shader.h
src/gallium/drivers/radeonsi/si_shader_nir.c

index 0bb0b3a71a38f26097f06e047277436d82291509..7b3c015e90181c5695af45c65707728f0d7799bf 100644 (file)
@@ -1600,7 +1600,7 @@ static bool si_should_optimize_less(struct ac_llvm_compiler *compiler,
 
    /* For a crazy dEQP test containing 2597 memory opcodes, mostly
     * buffer stores. */
-   return sel->info.stage == MESA_SHADER_COMPUTE && sel->info.num_memory_instructions > 1000;
+   return sel->info.stage == MESA_SHADER_COMPUTE && sel->info.num_memory_stores > 1000;
 }
 
 static struct nir_shader *get_nir_shader(struct si_shader_selector *sel, bool *free_nir)
index 9b325f1d48b9b46f71a01525662bdd8e99e87864..5de060489f21cc30811ee2998eb8297572855076 100644 (file)
@@ -337,7 +337,7 @@ struct si_shader_info {
    int constbuf0_num_slots;
    ubyte num_stream_output_components[4];
 
-   uint num_memory_instructions; /**< sampler, buffer, and image instructions */
+   uint num_memory_stores;
 
    ubyte colors_read; /**< which color components are read by the FS */
    ubyte colors_written;
index 369289f6fac9008b7f546551c772fb8acfa98bdd..c95e949c6af6d5a2841d996c400bbc206b4a0ac7 100644 (file)
@@ -324,11 +324,11 @@ static void scan_instruction(const struct nir_shader *nir, struct si_shader_info
       case nir_intrinsic_bindless_image_store:
          info->uses_bindless_images = true;
          info->writes_memory = true;
-         info->num_memory_instructions++; /* we only care about stores */
+         info->num_memory_stores++;
          break;
       case nir_intrinsic_image_deref_store:
          info->writes_memory = true;
-         info->num_memory_instructions++; /* we only care about stores */
+         info->num_memory_stores++;
          break;
       case nir_intrinsic_bindless_image_atomic_add:
       case nir_intrinsic_bindless_image_atomic_imin:
@@ -342,7 +342,7 @@ static void scan_instruction(const struct nir_shader *nir, struct si_shader_info
       case nir_intrinsic_bindless_image_atomic_comp_swap:
          info->uses_bindless_images = true;
          info->writes_memory = true;
-         info->num_memory_instructions++; /* we only care about stores */
+         info->num_memory_stores++;
          break;
       case nir_intrinsic_image_deref_atomic_add:
       case nir_intrinsic_image_deref_atomic_imin:
@@ -357,7 +357,7 @@ static void scan_instruction(const struct nir_shader *nir, struct si_shader_info
       case nir_intrinsic_image_deref_atomic_inc_wrap:
       case nir_intrinsic_image_deref_atomic_dec_wrap:
          info->writes_memory = true;
-         info->num_memory_instructions++; /* we only care about stores */
+         info->num_memory_stores++;
          break;
       case nir_intrinsic_store_ssbo:
       case nir_intrinsic_ssbo_atomic_add:
@@ -371,7 +371,7 @@ static void scan_instruction(const struct nir_shader *nir, struct si_shader_info
       case nir_intrinsic_ssbo_atomic_exchange:
       case nir_intrinsic_ssbo_atomic_comp_swap:
          info->writes_memory = true;
-         info->num_memory_instructions++; /* we only care about stores */
+         info->num_memory_stores++;
          break;
       case nir_intrinsic_load_color0:
       case nir_intrinsic_load_color1: {