Mesa (main): nir_to_tgsi: Run copy prop (and thus dce) after lower_bool_to_float.

GitLab Mirror gitlab-mirror at kemper.freedesktop.org
Wed Jul 7 23:56:25 UTC 2021


Module: Mesa
Branch: main
Commit: b4ad947135ce32264d8a58244547176cfb468ce4
URL:    http://cgit.freedesktop.org/mesa/mesa/commit/?id=b4ad947135ce32264d8a58244547176cfb468ce4

Author: Emma Anholt <emma at anholt.net>
Date:   Tue Jul  6 12:24:51 2021 -0700

nir_to_tgsi: Run copy prop (and thus dce) after lower_bool_to_float.

Fixes some i915g instruction count failures by eliminating some MOVs from
translating b2f32s.

Reviewed-by: Ilia Mirkin <imirkin at alum.mit.edu>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/11744>

---

 src/gallium/auxiliary/nir/nir_to_tgsi.c               | 3 +++
 src/gallium/drivers/i915/ci/deqp-i915-g33-fails.txt   | 8 --------
 src/gallium/drivers/i915/ci/piglit-i915-g33-fails.txt | 1 -
 3 files changed, 3 insertions(+), 9 deletions(-)

diff --git a/src/gallium/auxiliary/nir/nir_to_tgsi.c b/src/gallium/auxiliary/nir/nir_to_tgsi.c
index 475243bf2cb..9bc9e575cb2 100644
--- a/src/gallium/auxiliary/nir/nir_to_tgsi.c
+++ b/src/gallium/auxiliary/nir/nir_to_tgsi.c
@@ -2797,6 +2797,9 @@ nir_to_tgsi(struct nir_shader *s,
    } else {
       NIR_PASS_V(s, nir_lower_int_to_float);
       NIR_PASS_V(s, nir_lower_bool_to_float);
+      /* bool_to_float generates MOVs for b2f32 that we want to clean up. */
+      NIR_PASS_V(s, nir_copy_prop);
+      NIR_PASS_V(s, nir_opt_dce);
    }
 
    /* Only lower 32-bit floats.  The only other modifier type officially
diff --git a/src/gallium/drivers/i915/ci/deqp-i915-g33-fails.txt b/src/gallium/drivers/i915/ci/deqp-i915-g33-fails.txt
index ef9730a323f..8493bab444a 100644
--- a/src/gallium/drivers/i915/ci/deqp-i915-g33-fails.txt
+++ b/src/gallium/drivers/i915/ci/deqp-i915-g33-fails.txt
@@ -927,29 +927,21 @@ dEQP-GLES2.functional.uniform_api.random.71,Fail
 dEQP-GLES2.functional.uniform_api.random.74,Fail
 dEQP-GLES2.functional.uniform_api.random.80,Fail
 dEQP-GLES2.functional.uniform_api.random.81,Fail
-dEQP-GLES2.functional.uniform_api.value.assigned.by_pointer.render.array_in_struct.int_ivec4_both,Fail
 dEQP-GLES2.functional.uniform_api.value.assigned.by_pointer.render.array_in_struct.mat4_mat2_both,Fail
 dEQP-GLES2.functional.uniform_api.value.assigned.by_pointer.render.array_in_struct.mat4_mat2_fragment,Fail
 dEQP-GLES2.functional.uniform_api.value.assigned.by_pointer.render.array_in_struct.sampler2D_samplerCube_both,Fail
 dEQP-GLES2.functional.uniform_api.value.assigned.by_pointer.render.array_in_struct.sampler2D_samplerCube_fragment,Fail
 dEQP-GLES2.functional.uniform_api.value.assigned.by_pointer.render.basic_array.mat4_both,Fail
 dEQP-GLES2.functional.uniform_api.value.assigned.by_pointer.render.basic_array.mat4_fragment,Fail
-dEQP-GLES2.functional.uniform_api.value.assigned.by_pointer.render.multiple_basic_array.both,Fail
 dEQP-GLES2.functional.uniform_api.value.assigned.by_pointer.render.multiple_nested_structs_arrays.both,Fail
 dEQP-GLES2.functional.uniform_api.value.assigned.by_pointer.render.multiple_nested_structs_arrays.fragment,Fail
-dEQP-GLES2.functional.uniform_api.value.assigned.by_pointer.render.nested_structs_arrays.float_vec4_both,Fail
-dEQP-GLES2.functional.uniform_api.value.assigned.by_pointer.render.nested_structs_arrays.int_ivec4_both,Fail
 dEQP-GLES2.functional.uniform_api.value.assigned.by_pointer.render.nested_structs_arrays.mat4_mat2_fragment,Fail
 dEQP-GLES2.functional.uniform_api.value.assigned.by_pointer.render.struct_in_array.mat4_mat2_both,Fail
 dEQP-GLES2.functional.uniform_api.value.assigned.by_pointer.render.struct_in_array.mat4_mat2_fragment,Fail
-dEQP-GLES2.functional.uniform_api.value.assigned.by_value.render.array_in_struct.int_ivec4_both,Fail
 dEQP-GLES2.functional.uniform_api.value.assigned.by_value.render.array_in_struct.sampler2D_samplerCube_both,Fail
 dEQP-GLES2.functional.uniform_api.value.assigned.by_value.render.array_in_struct.sampler2D_samplerCube_fragment,Fail
-dEQP-GLES2.functional.uniform_api.value.assigned.by_value.render.multiple_basic_array.both,Fail
 dEQP-GLES2.functional.uniform_api.value.assigned.by_value.render.multiple_nested_structs_arrays.both,Fail
 dEQP-GLES2.functional.uniform_api.value.assigned.by_value.render.multiple_nested_structs_arrays.fragment,Fail
-dEQP-GLES2.functional.uniform_api.value.assigned.by_value.render.nested_structs_arrays.float_vec4_both,Fail
-dEQP-GLES2.functional.uniform_api.value.assigned.by_value.render.nested_structs_arrays.int_ivec4_both,Fail
 dEQP-GLES2.functional.uniform_api.value.initial.render.array_in_struct.mat4_mat2_both,Fail
 dEQP-GLES2.functional.uniform_api.value.initial.render.array_in_struct.mat4_mat2_fragment,Fail
 dEQP-GLES2.functional.uniform_api.value.initial.render.basic_array.mat4_both,Fail
diff --git a/src/gallium/drivers/i915/ci/piglit-i915-g33-fails.txt b/src/gallium/drivers/i915/ci/piglit-i915-g33-fails.txt
index d8376f3dfab..8ff87db8e4a 100644
--- a/src/gallium/drivers/i915/ci/piglit-i915-g33-fails.txt
+++ b/src/gallium/drivers/i915/ci/piglit-i915-g33-fails.txt
@@ -483,7 +483,6 @@ spec at ext_texture_srgb@texwrap formats-s3tc bordercolor at GL_COMPRESSED_SLUMINANCE_
 spec at ext_texture_srgb@texwrap formats-s3tc bordercolor at GL_COMPRESSED_SRGB- border color only,Fail
 spec at ext_texture_srgb@texwrap formats-s3tc bordercolor at GL_COMPRESSED_SRGB_ALPHA- border color only,Fail
 spec at ext_texture_srgb@texwrap formats-s3tc bordercolor at GL_COMPRESSED_SRGB_S3TC_DXT1_EXT- border color only,Fail
-spec at glsl-1.10@execution at built-in-functions@fs-atan-vec2-vec2,Fail
 spec at glsl-1.10@execution at built-in-functions@fs-atan-vec3-vec3,Fail
 spec at glsl-1.10@execution at built-in-functions@fs-atan-vec4-vec4,Fail
 spec at glsl-1.10@execution at built-in-functions@fs-cos-float,Fail



More information about the mesa-commit mailing list