diff options
author | Jason Ekstrand <[email protected]> | 2018-03-27 17:21:35 -0700 |
---|---|---|
committer | Jason Ekstrand <[email protected]> | 2018-06-22 20:54:00 -0700 |
commit | fa6ffcc0830bc97b82ad66fa8707e3bb39729b70 (patch) | |
tree | 61c53432e90a2e1b83b6de1bd61361eba5e31b2c /src/compiler | |
parent | c5d9a659447f7956b63809f827543ccebf6a391e (diff) |
nir/copy_prop_vars: Re-order some logic in compare_derefs
Acked-by: Rob Clark <[email protected]>
Acked-by: Bas Nieuwenhuizen <[email protected]>
Acked-by: Dave Airlie <[email protected]>
Reviewed-by: Kenneth Graunke <[email protected]>
Diffstat (limited to 'src/compiler')
-rw-r--r-- | src/compiler/nir/nir_opt_copy_prop_vars.c | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/src/compiler/nir/nir_opt_copy_prop_vars.c b/src/compiler/nir/nir_opt_copy_prop_vars.c index 2e1a2e0cd68..bf3b7933100 100644 --- a/src/compiler/nir/nir_opt_copy_prop_vars.c +++ b/src/compiler/nir/nir_opt_copy_prop_vars.c @@ -151,19 +151,19 @@ compare_derefs(nir_deref_var *a, nir_deref_var *b) nir_deref_array *a_arr = nir_deref_as_array(a_tail); nir_deref_array *b_arr = nir_deref_as_array(b_tail); - if (a_arr->deref_array_type == nir_deref_array_type_direct && - b_arr->deref_array_type == nir_deref_array_type_direct) { - /* If they're both direct and have different offsets, they - * don't even alias much less anything else. - */ - if (a_arr->base_offset != b_arr->base_offset) - return 0; - } else if (a_arr->deref_array_type == nir_deref_array_type_wildcard) { + if (a_arr->deref_array_type == nir_deref_array_type_wildcard) { if (b_arr->deref_array_type != nir_deref_array_type_wildcard) result &= ~derefs_b_contains_a_bit; } else if (b_arr->deref_array_type == nir_deref_array_type_wildcard) { if (a_arr->deref_array_type != nir_deref_array_type_wildcard) result &= ~derefs_a_contains_b_bit; + } else if (a_arr->deref_array_type == nir_deref_array_type_direct && + b_arr->deref_array_type == nir_deref_array_type_direct) { + /* If they're both direct and have different offsets, they + * don't even alias much less anything else. + */ + if (a_arr->base_offset != b_arr->base_offset) + return 0; } else if (a_arr->deref_array_type == nir_deref_array_type_indirect && b_arr->deref_array_type == nir_deref_array_type_indirect) { assert(a_arr->indirect.is_ssa && b_arr->indirect.is_ssa); |