[Mesa-dev] [PATCH v2] nir: fix nir_copy_propagation test

Jason Ekstrand jason at jlekstrand.net
Wed Oct 24 03:42:01 UTC 2018


Please CC and close https://bugs.freedesktop.org/show_bug.cgi?id=108532
when you push this.

--Jason

On Tue, Oct 23, 2018 at 12:12 PM Jason Ekstrand <jason at jlekstrand.net>
wrote:

> Reviewed-by: Jason Ekstrand <jason at jlekstrand.net>
>
> On Tue, Oct 23, 2018 at 9:55 AM Juan A. Suarez Romero <jasuarez at igalia.com>
> wrote:
>
>> Use nir_src_comp_as_uint() to read the proper second component, as
>> nir_src_as_uint() returns the first one.
>>
>> v2: Use nir_src_comp_as_uint() [Jason]
>>
>> Fixes: 16870de8a0a ("nir: Use nir_src_is_const and nir_src_as_* in core
>>                      code")
>> Signed-off-by: Juan A. Suarez Romero <jasuarez at igalia.com>
>> ---
>>  src/compiler/nir/tests/vars_tests.cpp | 4 ++--
>>  1 file changed, 2 insertions(+), 2 deletions(-)
>>
>> diff --git a/src/compiler/nir/tests/vars_tests.cpp
>> b/src/compiler/nir/tests/vars_tests.cpp
>> index 02c53804b84..a7bbeb02277 100644
>> --- a/src/compiler/nir/tests/vars_tests.cpp
>> +++ b/src/compiler/nir/tests/vars_tests.cpp
>> @@ -375,7 +375,7 @@ TEST_F(nir_copy_prop_vars_test,
>> store_store_load_different_components)
>>           ASSERT_TRUE(store_to_v1->src[1].is_ssa);
>>
>>           ASSERT_TRUE(nir_src_is_const(store_to_v1->src[1]));
>> -         ASSERT_EQ(nir_src_as_uint(store_to_v1->src[1]), 20);
>> +         ASSERT_EQ(nir_src_comp_as_uint(store_to_v1->src[1], 1), 20);
>>           break;
>>        }
>>     }
>> @@ -424,7 +424,7 @@ TEST_F(nir_copy_prop_vars_test,
>> store_store_load_different_components_in_many_bl
>>           ASSERT_TRUE(store_to_v1->src[1].is_ssa);
>>
>>           ASSERT_TRUE(nir_src_is_const(store_to_v1->src[1]));
>> -         ASSERT_EQ(nir_src_as_uint(store_to_v1->src[1]), 20);
>> +         ASSERT_EQ(nir_src_comp_as_uint(store_to_v1->src[1], 1), 20);
>>           break;
>>        }
>>     }
>> --
>> 2.17.2
>>
>>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.freedesktop.org/archives/mesa-dev/attachments/20181023/f736c241/attachment.html>


More information about the mesa-dev mailing list