diff options
-rw-r--r-- | src/glsl/nir/nir_opt_gcm.c | 11 |
1 files changed, 5 insertions, 6 deletions
diff --git a/src/glsl/nir/nir_opt_gcm.c b/src/glsl/nir/nir_opt_gcm.c index bf565b9698..8f805bf710 100644 --- a/src/glsl/nir/nir_opt_gcm.c +++ b/src/glsl/nir/nir_opt_gcm.c @@ -198,14 +198,13 @@ gcm_schedule_early_instr(nir_instr *instr, struct gcm_state *state); * instruction is lower down the tree. */ static bool -gcm_schedule_early_src(nir_src *src, void *void_state) +gcm_schedule_early_src(nir_ssa_def **src, void *void_state) { struct gcm_state *state = void_state; nir_instr *instr = state->instr; - assert(src->is_ssa); - gcm_schedule_early_instr(src->ssa->parent_instr, void_state); + gcm_schedule_early_instr((*src)->parent_instr, void_state); /* While the index isn't a proper dominance depth, it does have the * property that if A dominates B then A->index <= B->index. Since we @@ -214,8 +213,8 @@ gcm_schedule_early_src(nir_src *src, void *void_state) * all of the sources must lie on the same branch of the dominance tree. * Therefore, we can just go ahead and just compare indices. */ - if (instr->block->index < src->ssa->parent_instr->block->index) - instr->block = src->ssa->parent_instr->block; + if (instr->block->index < (*src)->parent_instr->block->index) + instr->block = (*src)->parent_instr->block; /* We need to restore the state instruction because it may have been * changed through the gcm_schedule_early_instr call above. Since we @@ -255,7 +254,7 @@ gcm_schedule_early_instr(nir_instr *instr, struct gcm_state *state) instr->block = state->impl->start_block; state->instr = instr; - nir_foreach_src(instr, gcm_schedule_early_src, state); + nir_foreach_ssa_src(instr, gcm_schedule_early_src, state); } static void |