[Mesa-dev] [PATCH 4/4] nir: reorder some code

Timothy Arceri tarceri at itsqueeze.com
Wed Feb 13 08:00:16 UTC 2019


The compile shoud do this for us so this is more for neatness
rather than speed.
---
 src/compiler/nir/nir_search.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/src/compiler/nir/nir_search.c b/src/compiler/nir/nir_search.c
index d257b639189..f0a79a54301 100644
--- a/src/compiler/nir/nir_search.c
+++ b/src/compiler/nir/nir_search.c
@@ -272,11 +272,10 @@ match_value(const nir_search_value *value, nir_alu_instr *instr, unsigned src,
    }
 
    case nir_search_value_constant: {
-      nir_search_constant *const_val = nir_search_value_as_constant(value);
-
       if (!nir_src_is_const(instr->src[src].src))
          return false;
 
+      nir_search_constant *const_val = nir_search_value_as_constant(value);
       switch (const_val->type) {
       case nir_type_float:
          for (unsigned i = 0; i < num_components; ++i) {
-- 
2.20.1



More information about the mesa-dev mailing list