---
 src/compiler/nir/nir_opt_copy_propagate.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/src/compiler/nir/nir_opt_copy_propagate.c 
b/src/compiler/nir/nir_opt_copy_propagate.c
index c35e8e1..c8821c3 100644
--- a/src/compiler/nir/nir_opt_copy_propagate.c
+++ b/src/compiler/nir/nir_opt_copy_propagate.c
@@ -101,11 +101,11 @@ is_swizzleless_move(nir_alu_instr *instr)
 static bool
 is_trivial_deref_cast(nir_deref_instr *cast)
 {
-   nir_deref_instr *parent = nir_src_as_deref(cast->parent);
-   if (!parent)
+   if (cast->deref_type != nir_deref_type_cast)
       return false;
 
-   if (cast->deref_type != nir_deref_type_cast)
+   nir_deref_instr *parent = nir_src_as_deref(cast->parent);
+   if (!parent)
       return false;
 
    return cast->mode == parent->mode &&
-- 
2.5.0.400.gff86faf

_______________________________________________
mesa-dev mailing list
mesa-dev@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/mesa-dev

Reply via email to