summaryrefslogtreecommitdiffstats
path: root/src/compiler/nir
diff options
context:
space:
mode:
authorCaio Marcelo de Oliveira Filho <[email protected]>2018-04-10 23:13:39 -0700
committerJason Ekstrand <[email protected]>2018-04-11 11:05:05 -0700
commitfac9dd1b93829a84f634525ce41f18953fe92433 (patch)
tree486a442de0e2dca7e8854f6f0baf524854eaeec0 /src/compiler/nir
parent1c9bccdeb8acf1a531b49bbb6c69ea96879e79de (diff)
nir/vars_to_ssa: Remove an unnecessary deref_arry_type check
Only fully-qualified direct derefs, collected in direct_deref_nodes, are checked for aliasing, so it is already known up front that they have only array derefs of type direct. Reviewed-by: Jason Ekstrand <[email protected]>
Diffstat (limited to 'src/compiler/nir')
-rw-r--r--src/compiler/nir/nir_lower_vars_to_ssa.c9
1 files changed, 5 insertions, 4 deletions
diff --git a/src/compiler/nir/nir_lower_vars_to_ssa.c b/src/compiler/nir/nir_lower_vars_to_ssa.c
index f327a14d9b3..970eb05307a 100644
--- a/src/compiler/nir/nir_lower_vars_to_ssa.c
+++ b/src/compiler/nir/nir_lower_vars_to_ssa.c
@@ -298,15 +298,16 @@ deref_may_be_aliased_node(struct deref_node *node, nir_deref *deref,
switch (deref->child->deref_type) {
case nir_deref_type_array: {
nir_deref_array *arr = nir_deref_as_array(deref->child);
- if (arr->deref_array_type == nir_deref_array_type_indirect)
- return true;
+
+ /* This is a child of one of the derefs in direct_deref_nodes,
+ * so we know it is direct.
+ */
+ assert(arr->deref_array_type == nir_deref_array_type_direct);
/* If there is an indirect at this level, we're aliased. */
if (node->indirect)
return true;
- assert(arr->deref_array_type == nir_deref_array_type_direct);
-
if (node->children[arr->base_offset] &&
deref_may_be_aliased_node(node->children[arr->base_offset],
deref->child, state))