nir/split_vars: Don't compact vectors unnecessarily
authorJason Ekstrand <jason.ekstrand@intel.com>
Sat, 23 Feb 2019 04:10:55 +0000 (22:10 -0600)
committerJason Ekstrand <jason.ekstrand@intel.com>
Mon, 25 Feb 2019 02:01:18 +0000 (20:01 -0600)
Reviewed-by: Alejandro PiƱeiro <apinheiro@igalia.com>
src/compiler/nir/nir_split_vars.c

index 244ffd6dcf0ec467399c1b6878b8192a35422ff1..96b6042e6d96f153251e874781df4980ce03943a 100644 (file)
@@ -1423,6 +1423,12 @@ shrink_vec_var_access_impl(nir_function_impl *impl,
                continue;
             }
 
+            /* If we're not dropping any components, there's no need to
+             * compact vectors.
+             */
+            if (usage->comps_kept == usage->all_comps)
+               continue;
+
             if (intrin->intrinsic == nir_intrinsic_load_deref) {
                b.cursor = nir_after_instr(&intrin->instr);