[Mesa-dev] [PATCH] nir: fix nir_copy_propagation test
Juan A. Suarez Romero
jasuarez at igalia.com
Tue Oct 23 14:47:44 UTC 2018
On Tue, 2018-10-23 at 09:26 -0500, Jason Ekstrand wrote:
> The commit message is correct but doesn't match the patch.
>
> On October 23, 2018 08:59:25 "Juan A. Suarez Romero" <jasuarez at igalia.com>
> wrote:
>
> > Commit 16870de8a0a introduced the use of nir_src_as_* functions, so
> > copy_propagation tests need to check expected value for the first
> > component.
> >
> >
> > 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..fdb3317ca02 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_as_uint(store_to_v1->src[1]), 30);
>
> I don't think we want to change from 20 to 30 here. Instead, we want to use
> nir_src_comp_as_uint to get component 1.
>
Right. Didn't realize about this function. Thanks!
J.A.
> --Jason
>
> > 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_as_uint(store_to_v1->src[1]), 30);
> > break;
> > }
> > }
> > --
> > 2.17.2
>
>
>
>
More information about the mesa-dev
mailing list