From: Marek Olšák Date: Sun, 6 Sep 2020 15:18:39 +0000 (-0400) Subject: radeonsi: rename num_memory_instructions -> num_memory_stores X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=824fd6b2f8a815f59ac02bbef4bd1eb7e9c526cb;p=mesa.git radeonsi: rename num_memory_instructions -> num_memory_stores it only counts stores Reviewed-by: Pierre-Eric Pelloux-Prayer Part-of: --- diff --git a/src/gallium/drivers/radeonsi/si_shader.c b/src/gallium/drivers/radeonsi/si_shader.c index 0bb0b3a71a3..7b3c015e901 100644 --- a/src/gallium/drivers/radeonsi/si_shader.c +++ b/src/gallium/drivers/radeonsi/si_shader.c @@ -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) diff --git a/src/gallium/drivers/radeonsi/si_shader.h b/src/gallium/drivers/radeonsi/si_shader.h index 9b325f1d48b..5de060489f2 100644 --- a/src/gallium/drivers/radeonsi/si_shader.h +++ b/src/gallium/drivers/radeonsi/si_shader.h @@ -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; diff --git a/src/gallium/drivers/radeonsi/si_shader_nir.c b/src/gallium/drivers/radeonsi/si_shader_nir.c index 369289f6fac..c95e949c6af 100644 --- a/src/gallium/drivers/radeonsi/si_shader_nir.c +++ b/src/gallium/drivers/radeonsi/si_shader_nir.c @@ -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: {