aboutsummaryrefslogtreecommitdiffstats
path: root/src/compiler/nir/nir_opt_copy_prop_vars.c
diff options
context:
space:
mode:
authorJason Ekstrand <[email protected]>2018-03-16 09:52:04 -0700
committerJason Ekstrand <[email protected]>2018-03-30 17:20:27 -0700
commita1452a94fca458c1129f527b775e1124a449ed2b (patch)
tree99ec39fd4bb4a256d4a111a98198a425f3e69ab4 /src/compiler/nir/nir_opt_copy_prop_vars.c
parent956f17395bfcf7f8ce9dd5ac9fd14a13e86f3a8f (diff)
nir: Return a cursor from nir_instr_remove
Because nir_instr_remove is an inline wrapper around nir_instr_remove_v, the compiler should be able to tell that the return value is unused and not emit the extra code in most cases. Reviewed-by: Kenneth Graunke <[email protected]>
Diffstat (limited to 'src/compiler/nir/nir_opt_copy_prop_vars.c')
-rw-r--r--src/compiler/nir/nir_opt_copy_prop_vars.c19
1 files changed, 2 insertions, 17 deletions
diff --git a/src/compiler/nir/nir_opt_copy_prop_vars.c b/src/compiler/nir/nir_opt_copy_prop_vars.c
index 89ddc8dd406..cc8f00f9d37 100644
--- a/src/compiler/nir/nir_opt_copy_prop_vars.c
+++ b/src/compiler/nir/nir_opt_copy_prop_vars.c
@@ -349,21 +349,6 @@ store_to_entry(struct copy_prop_var_state *state, struct copy_entry *entry,
}
}
-/* Remove an instruction and return a cursor pointing to where it was */
-static nir_cursor
-instr_remove_cursor(nir_instr *instr)
-{
- nir_cursor cursor;
- nir_instr *prev = nir_instr_prev(instr);
- if (prev) {
- cursor = nir_after_instr(prev);
- } else {
- cursor = nir_before_block(instr->block);
- }
- nir_instr_remove(instr);
- return cursor;
-}
-
/* Do a "load" from an SSA-based entry return it in "value" as a value with a
* single SSA def. Because an entry could reference up to 4 different SSA
* defs, a vecN operation may be inserted to combine them into a single SSA
@@ -396,7 +381,7 @@ load_from_ssa_entry_value(struct copy_prop_var_state *state,
if (all_same) {
/* Our work here is done */
- b->cursor = instr_remove_cursor(&intrin->instr);
+ b->cursor = nir_instr_remove(&intrin->instr);
intrin->instr.block = NULL;
return true;
}
@@ -594,7 +579,7 @@ load_from_deref_entry_value(struct copy_prop_var_state *state,
value_tail->child = nir_deref_clone(src_tail->child, value_tail);
}
- b->cursor = instr_remove_cursor(&intrin->instr);
+ b->cursor = nir_instr_remove(&intrin->instr);
return true;
}