summaryrefslogtreecommitdiffstats
path: root/src/compiler/nir/nir_opt_gcm.c
diff options
context:
space:
mode:
authorConnor Abbott <[email protected]>2016-04-08 17:40:02 -0400
committerJason Ekstrand <[email protected]>2016-04-28 15:52:17 -0700
commit3afb3be6748509ab262ad4a22f5594219156e396 (patch)
treebc1864ef44d2a32e33ab4d52442efdc99be52e6e /src/compiler/nir/nir_opt_gcm.c
parenteecf96f5303973968a11fad8d786c34aa614d5ee (diff)
nir/opt_gcm: fixup for new foreach_block()
Reviewed-by: Jason Ekstrand <[email protected]>
Diffstat (limited to 'src/compiler/nir/nir_opt_gcm.c')
-rw-r--r--src/compiler/nir/nir_opt_gcm.c9
1 files changed, 5 insertions, 4 deletions
diff --git a/src/compiler/nir/nir_opt_gcm.c b/src/compiler/nir/nir_opt_gcm.c
index 25597ec5bbe..33278d8b1fc 100644
--- a/src/compiler/nir/nir_opt_gcm.c
+++ b/src/compiler/nir/nir_opt_gcm.c
@@ -105,10 +105,8 @@ gcm_build_block_info(struct exec_list *cf_list, struct gcm_state *state,
* to either GCM_INSTR_PINNED or 0.
*/
static bool
-gcm_pin_instructions_block(nir_block *block, void *void_state)
+gcm_pin_instructions_block(nir_block *block, struct gcm_state *state)
{
- struct gcm_state *state = void_state;
-
nir_foreach_instr_safe(block, instr) {
switch (instr->type) {
case nir_instr_type_alu:
@@ -467,7 +465,10 @@ opt_gcm_impl(nir_function_impl *impl)
nir_metadata_dominance);
gcm_build_block_info(&impl->body, &state, 0);
- nir_foreach_block_call(impl, gcm_pin_instructions_block, &state);
+
+ nir_foreach_block(block, impl) {
+ gcm_pin_instructions_block(block, &state);
+ }
foreach_list_typed(nir_instr, instr, node, &state.instrs)
gcm_schedule_early_instr(instr, &state);