From b4ad947135ce32264d8a58244547176cfb468ce4 Mon Sep 17 00:00:00 2001 From: Emma Anholt Date: Tue, 6 Jul 2021 12:24:51 -0700 Subject: [PATCH] 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 Part-of: --- 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 475243b..9bc9e57 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 ef9730a..8493bab 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 d8376f3..8ff87db 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@ext_texture_srgb@texwrap formats-s3tc bordercolor@GL_COMPRESSED_SLUMINANCE_ spec@ext_texture_srgb@texwrap formats-s3tc bordercolor@GL_COMPRESSED_SRGB- border color only,Fail spec@ext_texture_srgb@texwrap formats-s3tc bordercolor@GL_COMPRESSED_SRGB_ALPHA- border color only,Fail spec@ext_texture_srgb@texwrap formats-s3tc bordercolor@GL_COMPRESSED_SRGB_S3TC_DXT1_EXT- border color only,Fail -spec@glsl-1.10@execution@built-in-functions@fs-atan-vec2-vec2,Fail spec@glsl-1.10@execution@built-in-functions@fs-atan-vec3-vec3,Fail spec@glsl-1.10@execution@built-in-functions@fs-atan-vec4-vec4,Fail spec@glsl-1.10@execution@built-in-functions@fs-cos-float,Fail -- 2.7.4