Lines Matching defs:state

97 can_move_src(nir_src *src, void *state)
99 opt_preamble_ctx *ctx = state;
297 def_state *state = &ctx->states[ctx->def->index];
317 state->value += src_state->value;
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];
382 if (!state->can_move)
385 state->value = get_instr_cost(instr, options);
387 state->candidate = false;
388 state->must_stay = false;
394 state->candidate = true;
396 state->must_stay = true;
398 state->can_move_users++;
404 state->candidate = true;
406 state->must_stay = true;
410 if (state->candidate)
442 def_state *state = &ctx.states[def->index];
443 if (!state->can_move || state->must_stay)
455 if (!state->candidate && !state->must_stay) {
456 if (state->can_move_users > 0)
457 state->value /= state->can_move_users;
459 state->value = 0;
462 if (state->candidate) {
463 state->benefit = state->value -
466 if (state->benefit > 0) {
467 options->def_size(def, &state->size, &state->align);
468 total_size = ALIGN_POT(total_size, state->align);
469 total_size += state->size;
470 candidates[candidate_idx++] = state;
499 def_state *state = candidates[i];
500 offset = ALIGN_POT(offset, state->align);
502 if (offset + state->size > options->preamble_storage_size)
505 state->replace = true;
506 state->offset = offset;
508 offset += state->size;
531 def_state *state = &ctx.states[def->index];
532 if (!state->can_move)
559 if (state->replace) {
561 nir_store_preamble(b, clone_def, .base = state->offset);
574 def_state *state = &ctx.states[def->index];
575 if (!state->replace)
582 .base = state->offset);