summaryrefslogtreecommitdiffstats
path: root/src/compiler/nir/nir_opt_peephole_select.c
diff options
context:
space:
mode:
authorJason Ekstrand <jason.ekstrand@intel.com>2016-04-26 18:34:19 -0700
committerJason Ekstrand <jason.ekstrand@intel.com>2016-04-28 15:54:48 -0700
commit707e72f13bb78869ee95d3286980bf1709cba6cf (patch)
tree351ee47ca2ac2b54fb7ef0e8effa65a6e81b2c80 /src/compiler/nir/nir_opt_peephole_select.c
parent261d62de33b6192ec31f034a9897d034a37fa582 (diff)
downloadexternal_mesa3d-707e72f13bb78869ee95d3286980bf1709cba6cf.zip
external_mesa3d-707e72f13bb78869ee95d3286980bf1709cba6cf.tar.gz
external_mesa3d-707e72f13bb78869ee95d3286980bf1709cba6cf.tar.bz2
nir: Switch the arguments to nir_foreach_instr
This matches the "foreach x in container" pattern found in many other programming languages. Generated by the following regular expression: s/nir_foreach_instr(\([^,]*\),\s*\([^,]*\))/nir_foreach_instr(\2, \1)/ and similar expressions for nir_foreach_instr_safe etc. Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Diffstat (limited to 'src/compiler/nir/nir_opt_peephole_select.c')
-rw-r--r--src/compiler/nir/nir_opt_peephole_select.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/src/compiler/nir/nir_opt_peephole_select.c b/src/compiler/nir/nir_opt_peephole_select.c
index d783f7b..b31cc35 100644
--- a/src/compiler/nir/nir_opt_peephole_select.c
+++ b/src/compiler/nir/nir_opt_peephole_select.c
@@ -50,7 +50,7 @@
static bool
block_check_for_allowed_instrs(nir_block *block)
{
- nir_foreach_instr(block, instr) {
+ nir_foreach_instr(instr, block) {
switch (instr->type) {
case nir_instr_type_intrinsic: {
nir_intrinsic_instr *intrin = nir_instr_as_intrinsic(instr);
@@ -171,19 +171,19 @@ nir_opt_peephole_select_block(nir_block *block, void *mem_ctx)
* block before. We have already guaranteed that this is safe by
* calling block_check_for_allowed_instrs()
*/
- nir_foreach_instr_safe(then_block, instr) {
+ nir_foreach_instr_safe(instr, then_block) {
exec_node_remove(&instr->node);
instr->block = prev_block;
exec_list_push_tail(&prev_block->instr_list, &instr->node);
}
- nir_foreach_instr_safe(else_block, instr) {
+ nir_foreach_instr_safe(instr, else_block) {
exec_node_remove(&instr->node);
instr->block = prev_block;
exec_list_push_tail(&prev_block->instr_list, &instr->node);
}
- nir_foreach_instr_safe(block, instr) {
+ nir_foreach_instr_safe(instr, block) {
if (instr->type != nir_instr_type_phi)
break;