summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJason Ekstrand <[email protected]>2014-12-01 14:39:10 -0800
committerJason Ekstrand <[email protected]>2015-01-15 07:19:02 -0800
commit68778d52cd4eb05c62f77a13bfed5b062e124fea (patch)
treef4ed52bac654bf3628407a354e9a22e1721f68de
parent7c5284d0e52add862821ab13be61228e53867e62 (diff)
nir: Automatically update SSA if uses
Reviewed-by: Connor Abbott <[email protected]>
-rw-r--r--src/glsl/nir/nir.c9
1 files changed, 4 insertions, 5 deletions
diff --git a/src/glsl/nir/nir.c b/src/glsl/nir/nir.c
index 281683a542d..b6bd78d05e6 100644
--- a/src/glsl/nir/nir.c
+++ b/src/glsl/nir/nir.c
@@ -1010,13 +1010,12 @@ update_if_uses(nir_cf_node *node)
return;
nir_if *if_stmt = nir_cf_node_as_if(node);
- if (if_stmt->condition.is_ssa)
- return;
- nir_register *reg = if_stmt->condition.reg.reg;
- assert(reg != NULL);
+ struct set *if_uses_set = if_stmt->condition.is_ssa ?
+ if_stmt->condition.ssa->if_uses :
+ if_stmt->condition.reg.reg->uses;
- _mesa_set_add(reg->if_uses, _mesa_hash_pointer(if_stmt), if_stmt);
+ _mesa_set_add(if_uses_set, _mesa_hash_pointer(if_stmt), if_stmt);
}
void