summaryrefslogtreecommitdiff
path: root/src/compiler/nir/nir_opt_gcm.c
diff options
context:
space:
mode:
authorJason Ekstrand <jason.ekstrand@intel.com>2016-04-26 20:30:10 -0700
committerJason Ekstrand <jason.ekstrand@intel.com>2016-04-28 15:54:48 -0700
commit5015260a0598ada4865b2c6086fc669505f64749 (patch)
tree5525c401e8a64983d4db83fd08d61209aae24700 /src/compiler/nir/nir_opt_gcm.c
parent9464d8c49813aba77285e7465b96e92a91ed327c (diff)
downloadmesa-5015260a0598ada4865b2c6086fc669505f64749.tar.gz
nir: Switch the arguments to nir_foreach_use and friends
This matches the "foreach x in container" pattern found in many other programming languages. Generated by the following regular expression: s/nir_foreach_use(\([^,]*\),\s*\([^,]*\))/nir_foreach_use(\2, \1)/ and similar expressions for nir_foreach_use_safe, etc. Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Diffstat (limited to 'src/compiler/nir/nir_opt_gcm.c')
-rw-r--r--src/compiler/nir/nir_opt_gcm.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/compiler/nir/nir_opt_gcm.c b/src/compiler/nir/nir_opt_gcm.c
index 119b74d58bb..ff079b9535b 100644
--- a/src/compiler/nir/nir_opt_gcm.c
+++ b/src/compiler/nir/nir_opt_gcm.c
@@ -277,7 +277,7 @@ gcm_schedule_late_def(nir_ssa_def *def, void *void_state)
nir_block *lca = NULL;
- nir_foreach_use(def, use_src) {
+ nir_foreach_use(use_src, def) {
nir_instr *use_instr = use_src->parent_instr;
gcm_schedule_late_instr(use_instr, state);
@@ -301,7 +301,7 @@ gcm_schedule_late_def(nir_ssa_def *def, void *void_state)
}
}
- nir_foreach_if_use(def, use_src) {
+ nir_foreach_if_use(use_src, def) {
nir_if *if_stmt = use_src->parent_if;
/* For if statements, we consider the block to be the one immediately
@@ -374,7 +374,7 @@ gcm_place_instr(nir_instr *instr, struct gcm_state *state);
static bool
gcm_place_instr_def(nir_ssa_def *def, void *state)
{
- nir_foreach_use(def, use_src)
+ nir_foreach_use(use_src, def)
gcm_place_instr(use_src->parent_instr, state);
return false;