sem.no_sysval_output = 1;
/* Write just one component. */
- prev_chan->store_intr = nir_store_output(b, nir_instr_ssa_def(cur_chan->value),
+ prev_chan->store_intr = nir_store_output(b, nir_instr_def(cur_chan->value),
nir_imm_int(b, 0),
.base = prev->base,
.component = i % 4,
ret = nir_load_var(&b, hit_attribs[nir_intrinsic_base(intrin)]);
else
ret = nir_load_shared(&b, 1, 32, offset, .base = 0, .align_mul = 4);
- nir_def_rewrite_uses(nir_instr_ssa_def(instr), ret);
+ nir_def_rewrite_uses(nir_instr_def(instr), ret);
} else {
if (hit_attribs)
nir_store_var(&b, hit_attribs[nir_intrinsic_base(intrin)], intrin->src->ssa, 0x1);
static bool
avoid_instr(const nir_instr *instr, const void *data)
{
- const nir_def *def = nir_instr_ssa_def((nir_instr *)instr);
+ const nir_def *def = nir_instr_def((nir_instr *)instr);
/* Do not move bindless handles, since we need those to retain their constant
* base index.
/*@}*/
nir_def *
-nir_instr_ssa_def(nir_instr *instr)
+nir_instr_def(nir_instr *instr)
{
switch (instr->type) {
case nir_instr_type_alu:
continue;
}
- nir_def *old_def = nir_instr_ssa_def(instr);
+ nir_def *old_def = nir_instr_def(instr);
struct list_head old_uses;
if (old_def != NULL) {
/* We're about to ask the callback to generate a replacement for instr.
/** @} */
-nir_def *nir_instr_ssa_def(nir_instr *instr);
+nir_def *nir_instr_def(nir_instr *instr);
typedef bool (*nir_foreach_def_cb)(nir_def *def, void *state);
typedef bool (*nir_foreach_src_cb)(nir_src *src, void *state);
if (!can_move(instr, first->pass_flags))
continue;
- nir_def *def = nir_instr_ssa_def(instr);
+ nir_def *def = nir_instr_def(instr);
if (def) {
bool all_uses_after_last = true;
nir_intrinsic_set_image_array(_2darray_size, true);
nir_builder_instr_insert(b, &_2darray_size->instr);
- nir_def *size = nir_instr_ssa_def(&_2darray_size->instr);
+ nir_def *size = nir_instr_def(&_2darray_size->instr);
nir_scalar comps[NIR_MAX_VEC_COMPONENTS] = { 0 };
unsigned coord_comps = intrin->def.num_components;
for (unsigned c = 0; c < coord_comps; c++) {
memcpy(potential_remat.set, remat->set, BITSET_WORDS(remat->size) * sizeof(BITSET_WORD));
util_dynarray_foreach(buf, nir_instr *, instr_ptr) {
- nir_def *instr_ssa_def = nir_instr_ssa_def(*instr_ptr);
+ nir_def *instr_ssa_def = nir_instr_def(*instr_ptr);
/* If already in the potential rematerializable, nothing to do. */
if (BITSET_TEST(potential_remat.set, instr_ssa_def->index))
{
nir_instr *clone = nir_instr_clone_deep(b->shader, def->parent_instr, remap_table);
nir_builder_instr_insert(b, clone);
- return nir_instr_ssa_def(clone);
+ return nir_instr_def(clone);
}
static nir_def *
nir_def *last_def = NULL;
util_dynarray_foreach(buf, nir_instr *, instr_ptr) {
- nir_def *instr_ssa_def = nir_instr_ssa_def(*instr_ptr);
+ nir_def *instr_ssa_def = nir_instr_def(*instr_ptr);
unsigned ssa_index = instr_ssa_def->index;
if (fill_defs[ssa_index] != NULL &&
nir_foreach_block(block, impl) {
nir_foreach_instr(instr, block) {
- nir_def *def = nir_instr_ssa_def(instr);
+ nir_def *def = nir_instr_def(instr);
if (def == NULL)
continue;
unsigned max_scratch_size = shader->scratch_size;
nir_foreach_block(block, impl) {
nir_foreach_instr_safe(instr, block) {
- nir_def *def = nir_instr_ssa_def(instr);
+ nir_def *def = nir_instr_def(instr);
if (def != NULL) {
if (can_remat_ssa_def(def, &trivial_remat)) {
add_ssa_def_to_bitset(def, &trivial_remat);
*/
nir_foreach_block(block, impl) {
nir_foreach_instr_safe(instr, block) {
- nir_def *def = nir_instr_ssa_def(instr);
+ nir_def *def = nir_instr_def(instr);
if (def != NULL) {
struct nir_phi_builder_value *pbv =
get_phi_builder_value_for_def(def, &pbv_arr);
nir_instr_insert(b->cursor, instr);
b->cursor = nir_after_instr(instr);
- nir_def *def = nir_instr_ssa_def(instr);
+ nir_def *def = nir_instr_def(instr);
BITSET_SET(remat->set, def->index);
}
}
switch (stack->intrinsic) {
case nir_intrinsic_load_stack: {
b->cursor = nir_instr_remove(instr);
- nir_def *data, *old_data = nir_instr_ssa_def(instr);
+ nir_def *data, *old_data = nir_instr_def(instr);
if (state->address_format == nir_address_format_64bit_global) {
nir_def *addr = nir_iadd_imm(b,
const unsigned value_id = nir_intrinsic_value_id(intrin);
const unsigned mask =
- nir_def_components_read(nir_instr_ssa_def(instr));
+ nir_def_components_read(nir_instr_def(instr));
add_use_mask(value_id_to_mask, value_id, mask);
}
}
u_foreach_bit(idx, read_mask)
swiz_map[idx] = swiz_count++;
- nir_def *def = nir_instr_ssa_def(instr);
+ nir_def *def = nir_instr_def(instr);
nir_foreach_use_safe(use_src, def) {
if (use_src->parent_instr->type == nir_instr_type_alu) {
continue;
const unsigned value_id = nir_intrinsic_value_id(intrin);
- nir_def *def = nir_instr_ssa_def(instr);
+ nir_def *def = nir_instr_def(instr);
assert(_mesa_hash_table_u64_search(value_id_to_item,
value_id) == NULL);
continue;
/* Check all users in this block which is the first */
- const nir_def *def = nir_instr_ssa_def(instr);
+ const nir_def *def = nir_instr_def(instr);
nir_instr *first_user = instr == if_cond_instr ? NULL : last_instr;
nir_foreach_use(use, def) {
nir_instr *parent = use->parent_instr;
/* Step 1: Calculate can_move */
nir_foreach_block(block, impl) {
nir_foreach_instr(instr, block) {
- nir_def *def = nir_instr_ssa_def(instr);
+ nir_def *def = nir_instr_def(instr);
if (!def)
continue;
unsigned num_candidates = 0;
nir_foreach_block_reverse(block, impl) {
nir_foreach_instr_reverse(instr, block) {
- nir_def *def = nir_instr_ssa_def(instr);
+ nir_def *def = nir_instr_def(instr);
if (!def)
continue;
state->candidate = false;
state->must_stay = false;
nir_foreach_use(use, def) {
- nir_def *use_def = nir_instr_ssa_def(use->parent_instr);
+ nir_def *use_def = nir_instr_def(use->parent_instr);
if (!use_def || !ctx.states[use_def->index].can_move ||
ctx.states[use_def->index].must_stay) {
if (is_candidate)
*/
nir_foreach_block(block, impl) {
nir_foreach_instr(instr, block) {
- nir_def *def = nir_instr_ssa_def(instr);
+ nir_def *def = nir_instr_def(instr);
if (!def)
continue;
nir_foreach_block(block, impl) {
nir_foreach_instr(instr, block) {
- nir_def *def = nir_instr_ssa_def(instr);
+ nir_def *def = nir_instr_def(instr);
if (!def)
continue;
}
if (state->replace) {
- nir_def *clone_def = nir_instr_ssa_def(clone);
+ nir_def *clone_def = nir_instr_def(clone);
nir_store_preamble(b, clone_def, .base = state->offset);
}
}
nir_foreach_block(block, impl) {
nir_foreach_instr_safe(instr, block) {
- nir_def *def = nir_instr_ssa_def(instr);
+ nir_def *def = nir_instr_def(instr);
if (!def)
continue;
if (!nir_can_move_instr(instr, options))
continue;
- nir_def *def = nir_instr_ssa_def(instr);
+ nir_def *def = nir_instr_def(instr);
bool sink_out_of_loops =
instr->type != nir_instr_type_intrinsic ||
struct util_dynarray *states,
const struct per_op_table *pass_op_table)
{
- nir_def *def = nir_instr_ssa_def(instr);
+ nir_def *def = nir_instr_def(instr);
nir_foreach_use_safe(use_src, def) {
if (nir_algebraic_automaton(use_src->parent_instr, states, pass_op_table))
b->cursor = nir_after_instr(instr);
- nir_def *pos = nir_instr_ssa_def(instr);
+ nir_def *pos = nir_instr_def(instr);
nir_def *depth = nir_channel(b, pos, 2);
assert(depth_transform_var);
continue;
}
- if (nir_instr_ssa_def(instr)->bit_size != 64)
+ if (nir_instr_def(instr)->bit_size != 64)
continue;
intrinsic->def.bit_size = 32;