Lines Matching refs:ctx
99 opt_preamble_ctx *ctx = state;
102 return ctx->states[src->ssa->index].can_move;
106 can_move_srcs(nir_instr *instr, opt_preamble_ctx *ctx)
108 return nir_foreach_src(instr, can_move_src, ctx);
112 can_move_intrinsic(nir_intrinsic_instr *instr, opt_preamble_ctx *ctx)
159 return ctx->options->drawid_uniform;
163 return ctx->options->subgroup_size_uniform;
194 return can_move_srcs(&instr->instr, ctx);
204 can_move_srcs(&instr->instr, ctx);
212 can_move_instr(nir_instr *instr, opt_preamble_ctx *ctx)
224 return can_move_srcs(instr, ctx);
241 return can_move_srcs(instr, ctx);
245 return can_move_intrinsic(nir_instr_as_intrinsic(instr), ctx);
262 return can_move_srcs(instr, ctx);
295 opt_preamble_ctx *ctx = data;
297 def_state *state = &ctx->states[ctx->def->index];
298 def_state *src_state = &ctx->states[src->ssa->index];
341 opt_preamble_ctx ctx = {
346 ctx.states = calloc(impl->ssa_alloc, sizeof(*ctx.states));
355 def_state *state = &ctx.states[def->index];
357 state->can_move = can_move_instr(instr, &ctx);
381 def_state *state = &ctx.states[def->index];
391 if (!use_def || !ctx.states[use_def->index].can_move ||
392 ctx.states[use_def->index].must_stay) {
417 free(ctx.states);
442 def_state *state = &ctx.states[def->index];
446 ctx.def = def;
447 nir_foreach_src(instr, update_src_value, &ctx);
481 free(ctx.states);
531 def_state *state = &ctx.states[def->index];
574 def_state *state = &ctx.states[def->index];
595 free(ctx.states);