summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJason Ekstrand <jason.ekstrand@intel.com>2018-11-19 12:32:16 -0600
committerJason Ekstrand <jason.ekstrand@intel.com>2018-11-28 14:29:25 -0600
commit199a0353d6a6568982aaf015dc91bdf8db17e88b (patch)
tree06af013878a178bd2390436b80211351dd4766e7
parenteb44c36cf1729e7e200b77cf8ea755dff72d1639 (diff)
nir/derefs: Add a nir_derefs_do_not_alias enum value
This makes some of the code more clear. Reviewed-by: Thomas Helland <thomashelland90@gmail.com>
-rw-r--r--src/compiler/nir/nir_deref.c6
-rw-r--r--src/compiler/nir/nir_deref.h1
2 files changed, 4 insertions, 3 deletions
diff --git a/src/compiler/nir/nir_deref.c b/src/compiler/nir/nir_deref.c
index 4a2e81956d1..7a625bcf92b 100644
--- a/src/compiler/nir/nir_deref.c
+++ b/src/compiler/nir/nir_deref.c
@@ -277,7 +277,7 @@ nir_compare_deref_paths(nir_deref_path *a_path,
nir_deref_path *b_path)
{
if (a_path->path[0]->var != b_path->path[0]->var)
- return 0;
+ return nir_derefs_do_not_alias;
/* Start off assuming they fully compare. We ignore equality for now. In
* the end, we'll determine that by containment.
@@ -319,7 +319,7 @@ nir_compare_deref_paths(nir_deref_path *a_path,
*/
if (nir_src_as_uint(a_tail->arr.index) !=
nir_src_as_uint(b_tail->arr.index))
- return 0;
+ return nir_derefs_do_not_alias;
} else if (a_tail->arr.index.ssa == b_tail->arr.index.ssa) {
/* They're the same indirect, continue on */
} else {
@@ -335,7 +335,7 @@ nir_compare_deref_paths(nir_deref_path *a_path,
case nir_deref_type_struct: {
/* If they're different struct members, they don't even alias */
if (a_tail->strct.index != b_tail->strct.index)
- return 0;
+ return nir_derefs_do_not_alias;
break;
}
diff --git a/src/compiler/nir/nir_deref.h b/src/compiler/nir/nir_deref.h
index c61c3f9366f..20d40377e6e 100644
--- a/src/compiler/nir/nir_deref.h
+++ b/src/compiler/nir/nir_deref.h
@@ -55,6 +55,7 @@ nir_ssa_def *nir_build_deref_offset(nir_builder *b, nir_deref_instr *deref,
glsl_type_size_align_func size_align);
typedef enum {
+ nir_derefs_do_not_alias = 0,
nir_derefs_equal_bit = (1 << 0),
nir_derefs_may_alias_bit = (1 << 1),
nir_derefs_a_contains_b_bit = (1 << 2),