nir: Rename nir_instr_type_ssa_undef to nir_instr_type_undef
We already renamed the type, we just need to rename the enum and the casting helper functions. Generated with sed: sed -i -e 's/nir_instr_type_ssa_undef/nir_instr_type_undef/g' src/**/*.h src/**/*.c src/**/*.cpp sed -i -e 's/nir_instr_as_ssa_undef/nir_instr_as_undef/g' src/**/*.h src/**/*.c src/**/*.cpp and two tiny whitespace fixups in lima. Reviewed-by: Alyssa Rosenzweig <alyssa@rosenzweig.io> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24703>
This commit is contained in:

committed by
Marge Bot

parent
252bff0f48
commit
65b6ac8aa4
@@ -271,7 +271,7 @@ bool ac_nir_optimize_outputs(nir_shader *nir, bool sprite_tex_disallowed,
|
||||
/* nir_lower_io_to_scalar is required before this */
|
||||
assert(intr->src[0].ssa->num_components == 1);
|
||||
/* No intrinsic should store undef. */
|
||||
assert(intr->src[0].ssa->parent_instr->type != nir_instr_type_ssa_undef);
|
||||
assert(intr->src[0].ssa->parent_instr->type != nir_instr_type_undef);
|
||||
|
||||
/* Gather the output. */
|
||||
struct ac_out_info *out_info = &outputs[sem.location];
|
||||
|
@@ -9742,7 +9742,7 @@ Operand
|
||||
get_phi_operand(isel_context* ctx, nir_def* ssa, RegClass rc, bool logical)
|
||||
{
|
||||
Temp tmp = get_ssa_temp(ctx, ssa);
|
||||
if (ssa->parent_instr->type == nir_instr_type_ssa_undef) {
|
||||
if (ssa->parent_instr->type == nir_instr_type_undef) {
|
||||
return Operand(rc);
|
||||
} else if (logical && ssa->bit_size == 1 &&
|
||||
ssa->parent_instr->type == nir_instr_type_load_const) {
|
||||
@@ -10093,7 +10093,7 @@ visit_block(isel_context* ctx, nir_block* block)
|
||||
case nir_instr_type_intrinsic: visit_intrinsic(ctx, nir_instr_as_intrinsic(instr)); break;
|
||||
case nir_instr_type_tex: visit_tex(ctx, nir_instr_as_tex(instr)); break;
|
||||
case nir_instr_type_phi: visit_phi(ctx, nir_instr_as_phi(instr)); break;
|
||||
case nir_instr_type_ssa_undef: visit_undef(ctx, nir_instr_as_ssa_undef(instr)); break;
|
||||
case nir_instr_type_undef: visit_undef(ctx, nir_instr_as_undef(instr)); break;
|
||||
case nir_instr_type_deref: break;
|
||||
case nir_instr_type_jump: visit_jump(ctx, nir_instr_as_jump(instr)); break;
|
||||
default: isel_err(instr, "Unknown NIR instr type");
|
||||
|
@@ -590,11 +590,11 @@ init_context(isel_context* ctx, nir_shader* shader)
|
||||
regclasses[tex->def.index] = rc;
|
||||
break;
|
||||
}
|
||||
case nir_instr_type_ssa_undef: {
|
||||
unsigned num_components = nir_instr_as_ssa_undef(instr)->def.num_components;
|
||||
unsigned bit_size = nir_instr_as_ssa_undef(instr)->def.bit_size;
|
||||
case nir_instr_type_undef: {
|
||||
unsigned num_components = nir_instr_as_undef(instr)->def.num_components;
|
||||
unsigned bit_size = nir_instr_as_undef(instr)->def.bit_size;
|
||||
RegClass rc = get_reg_class(ctx, RegType::sgpr, num_components, bit_size);
|
||||
regclasses[nir_instr_as_ssa_undef(instr)->def.index] = rc;
|
||||
regclasses[nir_instr_as_undef(instr)->def.index] = rc;
|
||||
break;
|
||||
}
|
||||
case nir_instr_type_phi: {
|
||||
|
@@ -4227,8 +4227,8 @@ static bool visit_block(struct ac_nir_context *ctx, nir_block *block)
|
||||
break;
|
||||
case nir_instr_type_phi:
|
||||
break;
|
||||
case nir_instr_type_ssa_undef:
|
||||
visit_ssa_undef(ctx, nir_instr_as_ssa_undef(instr));
|
||||
case nir_instr_type_undef:
|
||||
visit_ssa_undef(ctx, nir_instr_as_undef(instr));
|
||||
break;
|
||||
case nir_instr_type_jump:
|
||||
if (!visit_jump(&ctx->ac, nir_instr_as_jump(instr)))
|
||||
|
@@ -1834,8 +1834,8 @@ agx_emit_instr(agx_builder *b, struct nir_instr *instr)
|
||||
agx_emit_phi(b, nir_instr_as_phi(instr));
|
||||
break;
|
||||
|
||||
case nir_instr_type_ssa_undef:
|
||||
agx_emit_undef(b, nir_instr_as_ssa_undef(instr));
|
||||
case nir_instr_type_undef:
|
||||
agx_emit_undef(b, nir_instr_as_undef(instr));
|
||||
break;
|
||||
|
||||
default:
|
||||
|
@@ -3820,7 +3820,7 @@ is_cheap_block(nir_block *block)
|
||||
nir_foreach_instr(instr, block) {
|
||||
switch (instr->type) {
|
||||
case nir_instr_type_alu:
|
||||
case nir_instr_type_ssa_undef:
|
||||
case nir_instr_type_undef:
|
||||
case nir_instr_type_load_const:
|
||||
if (--cost <= 0)
|
||||
return false;
|
||||
@@ -4129,7 +4129,7 @@ ntq_emit_instr(struct v3d_compile *c, nir_instr *instr)
|
||||
ntq_emit_load_const(c, nir_instr_as_load_const(instr));
|
||||
break;
|
||||
|
||||
case nir_instr_type_ssa_undef:
|
||||
case nir_instr_type_undef:
|
||||
unreachable("Should've been lowered by nir_lower_undef_to_zero");
|
||||
break;
|
||||
|
||||
|
@@ -1157,7 +1157,7 @@ v3d_instr_delay_cb(nir_instr *instr, void *data)
|
||||
struct v3d_compile *c = (struct v3d_compile *) data;
|
||||
|
||||
switch (instr->type) {
|
||||
case nir_instr_type_ssa_undef:
|
||||
case nir_instr_type_undef:
|
||||
case nir_instr_type_load_const:
|
||||
case nir_instr_type_alu:
|
||||
case nir_instr_type_deref:
|
||||
|
@@ -876,7 +876,7 @@ nir_undef_instr_create(nir_shader *shader,
|
||||
unsigned bit_size)
|
||||
{
|
||||
nir_undef_instr *instr = gc_alloc(shader->gctx, nir_undef_instr, 1);
|
||||
instr_init(&instr->instr, nir_instr_type_ssa_undef);
|
||||
instr_init(&instr->instr, nir_instr_type_undef);
|
||||
|
||||
nir_def_init(&instr->instr, &instr->def, num_components, bit_size);
|
||||
|
||||
@@ -1316,8 +1316,8 @@ nir_instr_ssa_def(nir_instr *instr)
|
||||
case nir_instr_type_load_const:
|
||||
return &nir_instr_as_load_const(instr)->def;
|
||||
|
||||
case nir_instr_type_ssa_undef:
|
||||
return &nir_instr_as_ssa_undef(instr)->def;
|
||||
case nir_instr_type_undef:
|
||||
return &nir_instr_as_undef(instr)->def;
|
||||
|
||||
case nir_instr_type_call:
|
||||
case nir_instr_type_jump:
|
||||
|
@@ -895,7 +895,7 @@ typedef enum ENUM_PACKED {
|
||||
nir_instr_type_intrinsic,
|
||||
nir_instr_type_load_const,
|
||||
nir_instr_type_jump,
|
||||
nir_instr_type_ssa_undef,
|
||||
nir_instr_type_undef,
|
||||
nir_instr_type_phi,
|
||||
nir_instr_type_parallel_copy,
|
||||
} nir_instr_type;
|
||||
@@ -1069,7 +1069,7 @@ nir_src_is_const(nir_src src)
|
||||
static inline bool
|
||||
nir_src_is_undef(nir_src src)
|
||||
{
|
||||
return src.ssa->parent_instr->type == nir_instr_type_ssa_undef;
|
||||
return src.ssa->parent_instr->type == nir_instr_type_undef;
|
||||
}
|
||||
|
||||
static inline bool
|
||||
@@ -2518,8 +2518,8 @@ NIR_DEFINE_CAST(nir_instr_as_intrinsic, nir_instr, nir_intrinsic_instr, instr,
|
||||
type, nir_instr_type_intrinsic)
|
||||
NIR_DEFINE_CAST(nir_instr_as_load_const, nir_instr, nir_load_const_instr, instr,
|
||||
type, nir_instr_type_load_const)
|
||||
NIR_DEFINE_CAST(nir_instr_as_ssa_undef, nir_instr, nir_undef_instr, instr,
|
||||
type, nir_instr_type_ssa_undef)
|
||||
NIR_DEFINE_CAST(nir_instr_as_undef, nir_instr, nir_undef_instr, instr,
|
||||
type, nir_instr_type_undef)
|
||||
NIR_DEFINE_CAST(nir_instr_as_phi, nir_instr, nir_phi_instr, instr,
|
||||
type, nir_instr_type_phi)
|
||||
NIR_DEFINE_CAST(nir_instr_as_parallel_copy, nir_instr,
|
||||
@@ -2566,7 +2566,7 @@ nir_scalar_is_const(nir_scalar s)
|
||||
static inline bool
|
||||
nir_scalar_is_undef(nir_scalar s)
|
||||
{
|
||||
return s.def->parent_instr->type == nir_instr_type_ssa_undef;
|
||||
return s.def->parent_instr->type == nir_instr_type_undef;
|
||||
}
|
||||
|
||||
static inline nir_const_value
|
||||
|
@@ -434,8 +434,8 @@ clone_instr(clone_state *state, const nir_instr *instr)
|
||||
return &clone_intrinsic(state, nir_instr_as_intrinsic(instr))->instr;
|
||||
case nir_instr_type_load_const:
|
||||
return &clone_load_const(state, nir_instr_as_load_const(instr))->instr;
|
||||
case nir_instr_type_ssa_undef:
|
||||
return &clone_ssa_undef(state, nir_instr_as_ssa_undef(instr))->instr;
|
||||
case nir_instr_type_undef:
|
||||
return &clone_ssa_undef(state, nir_instr_as_undef(instr))->instr;
|
||||
case nir_instr_type_tex:
|
||||
return &clone_tex(state, nir_instr_as_tex(instr))->instr;
|
||||
case nir_instr_type_phi:
|
||||
|
@@ -791,8 +791,8 @@ update_instr_divergence(nir_shader *shader, nir_instr *instr)
|
||||
return visit_tex(nir_instr_as_tex(instr));
|
||||
case nir_instr_type_load_const:
|
||||
return visit_load_const(nir_instr_as_load_const(instr));
|
||||
case nir_instr_type_ssa_undef:
|
||||
return visit_ssa_undef(nir_instr_as_ssa_undef(instr));
|
||||
case nir_instr_type_undef:
|
||||
return visit_ssa_undef(nir_instr_as_undef(instr));
|
||||
case nir_instr_type_deref:
|
||||
return visit_deref(shader, nir_instr_as_deref(instr));
|
||||
case nir_instr_type_jump:
|
||||
@@ -844,7 +844,7 @@ visit_if_merge_phi(nir_phi_instr *phi, bool if_cond_divergent)
|
||||
phi->def.divergent = true;
|
||||
return true;
|
||||
}
|
||||
if (src->src.ssa->parent_instr->type != nir_instr_type_ssa_undef) {
|
||||
if (src->src.ssa->parent_instr->type != nir_instr_type_undef) {
|
||||
defined_srcs++;
|
||||
}
|
||||
}
|
||||
|
@@ -58,10 +58,10 @@ struct from_ssa_state {
|
||||
static bool
|
||||
def_after(nir_def *a, nir_def *b)
|
||||
{
|
||||
if (a->parent_instr->type == nir_instr_type_ssa_undef)
|
||||
if (a->parent_instr->type == nir_instr_type_undef)
|
||||
return false;
|
||||
|
||||
if (b->parent_instr->type == nir_instr_type_ssa_undef)
|
||||
if (b->parent_instr->type == nir_instr_type_undef)
|
||||
return true;
|
||||
|
||||
/* If they're in the same block, we can rely on whichever instruction
|
||||
@@ -79,7 +79,7 @@ def_after(nir_def *a, nir_def *b)
|
||||
static bool
|
||||
ssa_def_dominates(nir_def *a, nir_def *b)
|
||||
{
|
||||
if (a->parent_instr->type == nir_instr_type_ssa_undef) {
|
||||
if (a->parent_instr->type == nir_instr_type_undef) {
|
||||
/* SSA undefs always dominate */
|
||||
return true;
|
||||
}
|
||||
@@ -572,7 +572,7 @@ static bool
|
||||
def_replace_with_reg(nir_def *def, nir_function_impl *impl)
|
||||
{
|
||||
/* These are handled elsewhere */
|
||||
assert(def->parent_instr->type != nir_instr_type_ssa_undef &&
|
||||
assert(def->parent_instr->type != nir_instr_type_undef &&
|
||||
def->parent_instr->type != nir_instr_type_load_const);
|
||||
|
||||
nir_builder b = nir_builder_create(impl);
|
||||
@@ -1246,9 +1246,9 @@ nir_lower_ssa_defs_to_regs_block(nir_block *block)
|
||||
const unsigned num_ssa = impl->ssa_alloc;
|
||||
|
||||
nir_foreach_instr_safe(instr, block) {
|
||||
if (instr->type == nir_instr_type_ssa_undef) {
|
||||
if (instr->type == nir_instr_type_undef) {
|
||||
/* Undefs are just a read of something never written. */
|
||||
nir_undef_instr *undef = nir_instr_as_ssa_undef(instr);
|
||||
nir_undef_instr *undef = nir_instr_as_undef(instr);
|
||||
nir_def *reg = decl_reg_for_ssa_def(&b, &undef->def);
|
||||
nir_rewrite_uses_to_load_reg(&b, &undef->def, reg);
|
||||
} else if (instr->type == nir_instr_type_load_const) {
|
||||
|
@@ -127,7 +127,7 @@ can_move(nir_instr *instr, uint8_t current_indirection_level)
|
||||
instr->type == nir_instr_type_deref ||
|
||||
instr->type == nir_instr_type_tex ||
|
||||
instr->type == nir_instr_type_load_const ||
|
||||
instr->type == nir_instr_type_ssa_undef)
|
||||
instr->type == nir_instr_type_undef)
|
||||
return true;
|
||||
|
||||
if (instr->type == nir_instr_type_intrinsic &&
|
||||
|
@@ -29,8 +29,8 @@ _nir_foreach_def(nir_instr *instr, nir_foreach_def_cb cb, void *state)
|
||||
|
||||
case nir_instr_type_load_const:
|
||||
return cb(&nir_instr_as_load_const(instr)->def, state);
|
||||
case nir_instr_type_ssa_undef:
|
||||
return cb(&nir_instr_as_ssa_undef(instr)->def, state);
|
||||
case nir_instr_type_undef:
|
||||
return cb(&nir_instr_as_undef(instr)->def, state);
|
||||
|
||||
case nir_instr_type_call:
|
||||
case nir_instr_type_jump:
|
||||
@@ -133,7 +133,7 @@ nir_foreach_src(nir_instr *instr, nir_foreach_src_cb cb, void *state)
|
||||
}
|
||||
|
||||
case nir_instr_type_load_const:
|
||||
case nir_instr_type_ssa_undef:
|
||||
case nir_instr_type_undef:
|
||||
return true;
|
||||
|
||||
default:
|
||||
|
@@ -45,7 +45,7 @@ instr_can_rewrite(const nir_instr *instr)
|
||||
return nir_intrinsic_can_reorder(nir_instr_as_intrinsic(instr));
|
||||
case nir_instr_type_call:
|
||||
case nir_instr_type_jump:
|
||||
case nir_instr_type_ssa_undef:
|
||||
case nir_instr_type_undef:
|
||||
return false;
|
||||
case nir_instr_type_parallel_copy:
|
||||
default:
|
||||
@@ -703,7 +703,7 @@ nir_instrs_equal(const nir_instr *instr1, const nir_instr *instr2)
|
||||
}
|
||||
case nir_instr_type_call:
|
||||
case nir_instr_type_jump:
|
||||
case nir_instr_type_ssa_undef:
|
||||
case nir_instr_type_undef:
|
||||
case nir_instr_type_parallel_copy:
|
||||
default:
|
||||
unreachable("Invalid instruction type");
|
||||
|
@@ -315,8 +315,8 @@ nir_defs_interfere(nir_def *a, nir_def *b)
|
||||
* least one isn't dead.
|
||||
*/
|
||||
return true;
|
||||
} else if (a->parent_instr->type == nir_instr_type_ssa_undef ||
|
||||
b->parent_instr->type == nir_instr_type_ssa_undef) {
|
||||
} else if (a->parent_instr->type == nir_instr_type_undef ||
|
||||
b->parent_instr->type == nir_instr_type_undef) {
|
||||
/* If either variable is an ssa_undef, then there's no interference */
|
||||
return false;
|
||||
} else if (a->parent_instr->index < b->parent_instr->index) {
|
||||
|
@@ -147,7 +147,7 @@ nir_lower_array_deref_of_vec_impl(nir_function_impl *impl,
|
||||
nir_def *index = nir_ssa_for_src(&b, deref->arr.index, 1);
|
||||
nir_def *scalar =
|
||||
nir_vector_extract(&b, &intrin->def, index);
|
||||
if (scalar->parent_instr->type == nir_instr_type_ssa_undef) {
|
||||
if (scalar->parent_instr->type == nir_instr_type_undef) {
|
||||
nir_def_rewrite_uses(&intrin->def,
|
||||
scalar);
|
||||
nir_instr_remove(&intrin->instr);
|
||||
|
@@ -395,7 +395,7 @@ nir_lower_bool_to_bitsize_instr(nir_builder *b,
|
||||
case nir_instr_type_phi:
|
||||
return lower_phi_instr(b, nir_instr_as_phi(instr));
|
||||
|
||||
case nir_instr_type_ssa_undef:
|
||||
case nir_instr_type_undef:
|
||||
case nir_instr_type_intrinsic: {
|
||||
bool progress = false;
|
||||
nir_foreach_def(instr, rewrite_1bit_ssa_def_to_32bit, &progress);
|
||||
|
@@ -236,7 +236,7 @@ nir_lower_bool_to_float_instr(nir_builder *b,
|
||||
}
|
||||
|
||||
case nir_instr_type_intrinsic:
|
||||
case nir_instr_type_ssa_undef:
|
||||
case nir_instr_type_undef:
|
||||
case nir_instr_type_phi: {
|
||||
bool progress = false;
|
||||
nir_foreach_def(instr, rewrite_1bit_ssa_def_to_32bit, &progress);
|
||||
|
@@ -196,7 +196,7 @@ nir_lower_bool_to_int32_instr(UNUSED nir_builder *b,
|
||||
}
|
||||
|
||||
case nir_instr_type_intrinsic:
|
||||
case nir_instr_type_ssa_undef:
|
||||
case nir_instr_type_undef:
|
||||
case nir_instr_type_phi: {
|
||||
bool progress = false;
|
||||
nir_foreach_def(instr, rewrite_1bit_ssa_def_to_32bit, &progress);
|
||||
|
@@ -286,7 +286,7 @@ nir_lower_int_to_float_impl(nir_function_impl *impl)
|
||||
}
|
||||
|
||||
case nir_instr_type_intrinsic:
|
||||
case nir_instr_type_ssa_undef:
|
||||
case nir_instr_type_undef:
|
||||
case nir_instr_type_phi:
|
||||
case nir_instr_type_tex:
|
||||
break;
|
||||
|
@@ -72,7 +72,7 @@ is_phi_src_scalarizable(nir_phi_src *src,
|
||||
/* These are trivially scalarizable */
|
||||
return true;
|
||||
|
||||
case nir_instr_type_ssa_undef:
|
||||
case nir_instr_type_undef:
|
||||
/* The caller of this function is going to OR the results and we don't
|
||||
* want undefs to count so we return false.
|
||||
*/
|
||||
|
@@ -202,7 +202,7 @@ can_remat_instr(nir_instr *instr, struct sized_bitset *remat)
|
||||
}
|
||||
}
|
||||
|
||||
case nir_instr_type_ssa_undef:
|
||||
case nir_instr_type_undef:
|
||||
case nir_instr_type_load_const:
|
||||
return true;
|
||||
|
||||
|
@@ -43,10 +43,10 @@
|
||||
static bool
|
||||
lower_undef_instr_to_zero(nir_builder *b, nir_instr *instr, UNUSED void *_state)
|
||||
{
|
||||
if (instr->type != nir_instr_type_ssa_undef)
|
||||
if (instr->type != nir_instr_type_undef)
|
||||
return false;
|
||||
|
||||
nir_undef_instr *und = nir_instr_as_ssa_undef(instr);
|
||||
nir_undef_instr *und = nir_instr_as_undef(instr);
|
||||
b->cursor = nir_instr_remove(&und->instr);
|
||||
nir_def *zero = nir_imm_zero(b, und->def.num_components,
|
||||
und->def.bit_size);
|
||||
|
@@ -45,7 +45,7 @@ insert_store(nir_builder *b, nir_def *reg, nir_alu_instr *vec,
|
||||
}
|
||||
|
||||
/* No sense storing from undef, just return the write mask */
|
||||
if (src->parent_instr->type == nir_instr_type_ssa_undef)
|
||||
if (src->parent_instr->type == nir_instr_type_undef)
|
||||
return write_mask;
|
||||
|
||||
b->cursor = nir_before_instr(&vec->instr);
|
||||
|
@@ -84,8 +84,8 @@ is_live(BITSET_WORD *defs_live, nir_instr *instr)
|
||||
nir_load_const_instr *lc = nir_instr_as_load_const(instr);
|
||||
return is_def_live(&lc->def, defs_live);
|
||||
}
|
||||
case nir_instr_type_ssa_undef: {
|
||||
nir_undef_instr *undef = nir_instr_as_ssa_undef(instr);
|
||||
case nir_instr_type_undef: {
|
||||
nir_undef_instr *undef = nir_instr_as_undef(instr);
|
||||
return is_def_live(&undef->def, defs_live);
|
||||
}
|
||||
case nir_instr_type_parallel_copy: {
|
||||
|
@@ -186,7 +186,7 @@ is_src_scalarizable(nir_src *src)
|
||||
/* These are trivially scalarizable */
|
||||
return true;
|
||||
|
||||
case nir_instr_type_ssa_undef:
|
||||
case nir_instr_type_undef:
|
||||
return true;
|
||||
|
||||
case nir_instr_type_intrinsic: {
|
||||
@@ -383,7 +383,7 @@ gcm_pin_instructions(nir_function_impl *impl, struct gcm_state *state)
|
||||
break;
|
||||
|
||||
case nir_instr_type_jump:
|
||||
case nir_instr_type_ssa_undef:
|
||||
case nir_instr_type_undef:
|
||||
case nir_instr_type_phi:
|
||||
instr->pass_flags = GCM_INSTR_PLACED;
|
||||
break;
|
||||
|
@@ -433,7 +433,7 @@ opt_split_alu_of_phi(nir_builder *b, nir_loop *loop)
|
||||
nir_foreach_phi_src(src_of_phi, phi) {
|
||||
if (src_of_phi->pred == prev_block) {
|
||||
if (src_of_phi->src.ssa->parent_instr->type !=
|
||||
nir_instr_type_ssa_undef) {
|
||||
nir_instr_type_undef) {
|
||||
is_prev_result_undef = false;
|
||||
}
|
||||
|
||||
|
@@ -153,7 +153,7 @@ opt_move_discards_to_top_impl(nir_function_impl *impl)
|
||||
|
||||
case nir_instr_type_deref:
|
||||
case nir_instr_type_load_const:
|
||||
case nir_instr_type_ssa_undef:
|
||||
case nir_instr_type_undef:
|
||||
case nir_instr_type_phi:
|
||||
/* These are all safe */
|
||||
continue;
|
||||
|
@@ -70,7 +70,7 @@ block_check_for_allowed_instrs(nir_block *block, unsigned *count,
|
||||
case nir_instr_type_deref:
|
||||
case nir_instr_type_load_const:
|
||||
case nir_instr_type_phi:
|
||||
case nir_instr_type_ssa_undef:
|
||||
case nir_instr_type_undef:
|
||||
case nir_instr_type_tex:
|
||||
break;
|
||||
|
||||
@@ -164,7 +164,7 @@ block_check_for_allowed_instrs(nir_block *block, unsigned *count,
|
||||
|
||||
case nir_instr_type_deref:
|
||||
case nir_instr_type_load_const:
|
||||
case nir_instr_type_ssa_undef:
|
||||
case nir_instr_type_undef:
|
||||
break;
|
||||
|
||||
case nir_instr_type_alu: {
|
||||
|
@@ -86,7 +86,7 @@ get_instr_cost(nir_instr *instr, const nir_opt_preamble_options *options)
|
||||
* this for them.
|
||||
*/
|
||||
if (instr->type == nir_instr_type_load_const ||
|
||||
instr->type == nir_instr_type_ssa_undef)
|
||||
instr->type == nir_instr_type_undef)
|
||||
return 0;
|
||||
|
||||
return options->instr_cost_cb(instr, options->cb_data);
|
||||
@@ -252,7 +252,7 @@ can_move_instr(nir_instr *instr, opt_preamble_ctx *ctx)
|
||||
return can_move_intrinsic(nir_instr_as_intrinsic(instr), ctx);
|
||||
|
||||
case nir_instr_type_load_const:
|
||||
case nir_instr_type_ssa_undef:
|
||||
case nir_instr_type_undef:
|
||||
return true;
|
||||
|
||||
case nir_instr_type_deref: {
|
||||
|
@@ -514,8 +514,8 @@ opt_shrink_vectors_instr(nir_builder *b, nir_instr *instr)
|
||||
case nir_instr_type_load_const:
|
||||
return opt_shrink_vectors_load_const(nir_instr_as_load_const(instr));
|
||||
|
||||
case nir_instr_type_ssa_undef:
|
||||
return opt_shrink_vectors_ssa_undef(nir_instr_as_ssa_undef(instr));
|
||||
case nir_instr_type_undef:
|
||||
return opt_shrink_vectors_ssa_undef(nir_instr_as_undef(instr));
|
||||
|
||||
case nir_instr_type_phi:
|
||||
return opt_shrink_vectors_phi(b, nir_instr_as_phi(instr));
|
||||
|
@@ -40,7 +40,7 @@ nir_can_move_instr(nir_instr *instr, nir_move_options options)
|
||||
{
|
||||
switch (instr->type) {
|
||||
case nir_instr_type_load_const:
|
||||
case nir_instr_type_ssa_undef: {
|
||||
case nir_instr_type_undef: {
|
||||
return options & nir_move_const_undef;
|
||||
}
|
||||
case nir_instr_type_alu: {
|
||||
|
@@ -43,7 +43,7 @@ opt_undef_csel(nir_alu_instr *instr)
|
||||
|
||||
for (int i = 1; i <= 2; i++) {
|
||||
nir_instr *parent = instr->src[i].src.ssa->parent_instr;
|
||||
if (parent->type != nir_instr_type_ssa_undef)
|
||||
if (parent->type != nir_instr_type_undef)
|
||||
continue;
|
||||
|
||||
/* We can't just use nir_alu_src_copy, because we need the def/use
|
||||
@@ -76,7 +76,7 @@ opt_undef_vecN(nir_builder *b, nir_alu_instr *alu)
|
||||
return false;
|
||||
|
||||
for (unsigned i = 0; i < nir_op_infos[alu->op].num_inputs; i++) {
|
||||
if (alu->src[i].src.ssa->parent_instr->type != nir_instr_type_ssa_undef)
|
||||
if (alu->src[i].src.ssa->parent_instr->type != nir_instr_type_undef)
|
||||
return false;
|
||||
}
|
||||
|
||||
@@ -93,7 +93,7 @@ nir_get_undef_mask(nir_def *def)
|
||||
{
|
||||
nir_instr *instr = def->parent_instr;
|
||||
|
||||
if (instr->type == nir_instr_type_ssa_undef)
|
||||
if (instr->type == nir_instr_type_undef)
|
||||
return BITSET_MASK(def->num_components);
|
||||
|
||||
if (instr->type != nir_instr_type_alu)
|
||||
@@ -105,7 +105,7 @@ nir_get_undef_mask(nir_def *def)
|
||||
if (nir_op_is_vec(alu->op)) {
|
||||
for (int i = 0; i < nir_op_infos[alu->op].num_inputs; i++) {
|
||||
if (alu->src[i].src.ssa->parent_instr->type ==
|
||||
nir_instr_type_ssa_undef) {
|
||||
nir_instr_type_undef) {
|
||||
undef |= BITSET_MASK(nir_ssa_alu_instr_src_components(alu, i)) << i;
|
||||
}
|
||||
}
|
||||
|
@@ -1863,8 +1863,8 @@ print_instr(const nir_instr *instr, print_state *state, unsigned tabs)
|
||||
print_jump_instr(nir_instr_as_jump(instr), state);
|
||||
break;
|
||||
|
||||
case nir_instr_type_ssa_undef:
|
||||
print_ssa_undef_instr(nir_instr_as_ssa_undef(instr), state);
|
||||
case nir_instr_type_undef:
|
||||
print_ssa_undef_instr(nir_instr_as_undef(instr), state);
|
||||
break;
|
||||
|
||||
case nir_instr_type_phi:
|
||||
@@ -1893,7 +1893,7 @@ block_has_instruction_with_dest(nir_block *block)
|
||||
case nir_instr_type_deref:
|
||||
case nir_instr_type_alu:
|
||||
case nir_instr_type_tex:
|
||||
case nir_instr_type_ssa_undef:
|
||||
case nir_instr_type_undef:
|
||||
case nir_instr_type_phi:
|
||||
case nir_instr_type_parallel_copy:
|
||||
return true;
|
||||
|
@@ -124,7 +124,7 @@ propagate_invariant_instr(nir_instr *instr, struct set *invariants)
|
||||
|
||||
case nir_instr_type_deref:
|
||||
case nir_instr_type_jump:
|
||||
case nir_instr_type_ssa_undef:
|
||||
case nir_instr_type_undef:
|
||||
case nir_instr_type_load_const:
|
||||
break; /* Nothing to do */
|
||||
|
||||
|
@@ -446,7 +446,7 @@ nir_schedule_calculate_deps(nir_deps_state *state, nir_schedule_node *n)
|
||||
add_read_dep(state, state->jump, n);
|
||||
|
||||
switch (instr->type) {
|
||||
case nir_instr_type_ssa_undef:
|
||||
case nir_instr_type_undef:
|
||||
case nir_instr_type_load_const:
|
||||
case nir_instr_type_alu:
|
||||
case nir_instr_type_deref:
|
||||
@@ -1075,7 +1075,7 @@ nir_schedule_get_delay(nir_schedule_scoreboard *scoreboard, nir_instr *instr)
|
||||
}
|
||||
|
||||
switch (instr->type) {
|
||||
case nir_instr_type_ssa_undef:
|
||||
case nir_instr_type_undef:
|
||||
case nir_instr_type_load_const:
|
||||
case nir_instr_type_alu:
|
||||
case nir_instr_type_deref:
|
||||
|
@@ -1612,8 +1612,8 @@ write_instr(write_ctx *ctx, const nir_instr *instr)
|
||||
case nir_instr_type_load_const:
|
||||
write_load_const(ctx, nir_instr_as_load_const(instr));
|
||||
break;
|
||||
case nir_instr_type_ssa_undef:
|
||||
write_ssa_undef(ctx, nir_instr_as_ssa_undef(instr));
|
||||
case nir_instr_type_undef:
|
||||
write_ssa_undef(ctx, nir_instr_as_undef(instr));
|
||||
break;
|
||||
case nir_instr_type_tex:
|
||||
write_tex(ctx, nir_instr_as_tex(instr));
|
||||
@@ -1658,7 +1658,7 @@ read_instr(read_ctx *ctx, nir_block *block)
|
||||
case nir_instr_type_load_const:
|
||||
instr = &read_load_const(ctx, header)->instr;
|
||||
break;
|
||||
case nir_instr_type_ssa_undef:
|
||||
case nir_instr_type_undef:
|
||||
instr = &read_ssa_undef(ctx, header)->instr;
|
||||
break;
|
||||
case nir_instr_type_tex:
|
||||
|
@@ -168,7 +168,7 @@ instr_is_invariant(nir_instr *instr, nir_loop *loop)
|
||||
|
||||
switch (instr->type) {
|
||||
case nir_instr_type_load_const:
|
||||
case nir_instr_type_ssa_undef:
|
||||
case nir_instr_type_undef:
|
||||
return invariant;
|
||||
case nir_instr_type_call:
|
||||
return not_invariant;
|
||||
|
@@ -414,7 +414,7 @@ trivialize_stores(nir_function_impl *impl, nir_block *block)
|
||||
/* SSA-only instruction types */
|
||||
nir_instr *parent = value->parent_instr;
|
||||
nontrivial |= (parent->type == nir_instr_type_load_const) ||
|
||||
(parent->type == nir_instr_type_ssa_undef);
|
||||
(parent->type == nir_instr_type_undef);
|
||||
|
||||
/* Must be written in the same block */
|
||||
nontrivial |= (parent->block != block);
|
||||
|
@@ -1031,8 +1031,8 @@ validate_instr(nir_instr *instr, validate_state *state)
|
||||
validate_phi_instr(nir_instr_as_phi(instr), state);
|
||||
break;
|
||||
|
||||
case nir_instr_type_ssa_undef:
|
||||
validate_ssa_undef_instr(nir_instr_as_ssa_undef(instr), state);
|
||||
case nir_instr_type_undef:
|
||||
validate_ssa_undef_instr(nir_instr_as_undef(instr), state);
|
||||
break;
|
||||
|
||||
case nir_instr_type_jump:
|
||||
|
@@ -3431,7 +3431,7 @@ read_phi_src(struct ir3_context *ctx, struct ir3_block *blk,
|
||||
|
||||
nir_foreach_phi_src (nsrc, nphi) {
|
||||
if (blk->nblock == nsrc->pred) {
|
||||
if (nsrc->src.ssa->parent_instr->type == nir_instr_type_ssa_undef) {
|
||||
if (nsrc->src.ssa->parent_instr->type == nir_instr_type_undef) {
|
||||
/* Create an ir3 undef */
|
||||
return NULL;
|
||||
} else {
|
||||
@@ -3503,8 +3503,8 @@ emit_instr(struct ir3_context *ctx, nir_instr *instr)
|
||||
case nir_instr_type_load_const:
|
||||
emit_load_const(ctx, nir_instr_as_load_const(instr));
|
||||
break;
|
||||
case nir_instr_type_ssa_undef:
|
||||
emit_undef(ctx, nir_instr_as_ssa_undef(instr));
|
||||
case nir_instr_type_undef:
|
||||
emit_undef(ctx, nir_instr_as_undef(instr));
|
||||
break;
|
||||
case nir_instr_type_tex: {
|
||||
nir_tex_instr *tex = nir_instr_as_tex(instr);
|
||||
|
@@ -181,7 +181,7 @@ lower_64b_undef(nir_builder *b, nir_instr *instr, void *unused)
|
||||
{
|
||||
(void)unused;
|
||||
|
||||
nir_undef_instr *undef = nir_instr_as_ssa_undef(instr);
|
||||
nir_undef_instr *undef = nir_instr_as_undef(instr);
|
||||
unsigned num_comp = undef->def.num_components;
|
||||
nir_def *components[num_comp];
|
||||
|
||||
@@ -201,8 +201,8 @@ lower_64b_undef_filter(const nir_instr *instr, const void *unused)
|
||||
{
|
||||
(void)unused;
|
||||
|
||||
return instr->type == nir_instr_type_ssa_undef &&
|
||||
nir_instr_as_ssa_undef(instr)->def.bit_size == 64;
|
||||
return instr->type == nir_instr_type_undef &&
|
||||
nir_instr_as_undef(instr)->def.bit_size == 64;
|
||||
}
|
||||
|
||||
bool
|
||||
|
@@ -78,7 +78,7 @@ check_precondition_instr(precond_state *state, nir_instr *instr)
|
||||
case nir_instr_type_alu:
|
||||
case nir_instr_type_deref:
|
||||
case nir_instr_type_load_const:
|
||||
case nir_instr_type_ssa_undef:
|
||||
case nir_instr_type_undef:
|
||||
/* These could be safely moved around */
|
||||
break;
|
||||
case nir_instr_type_intrinsic: {
|
||||
|
@@ -2777,8 +2777,8 @@ visit_block(struct lp_build_nir_context *bld_base, nir_block *block)
|
||||
case nir_instr_type_phi:
|
||||
assert(0);
|
||||
break;
|
||||
case nir_instr_type_ssa_undef:
|
||||
visit_ssa_undef(bld_base, nir_instr_as_ssa_undef(instr));
|
||||
case nir_instr_type_undef:
|
||||
visit_ssa_undef(bld_base, nir_instr_as_undef(instr));
|
||||
break;
|
||||
case nir_instr_type_jump:
|
||||
visit_jump(bld_base, nir_instr_as_jump(instr));
|
||||
|
@@ -1268,7 +1268,7 @@ ntt_get_alu_src(struct ntt_compile *c, nir_alu_instr *instr, int i)
|
||||
* the specific swizzles from an undef don't matter)
|
||||
*/
|
||||
if (nir_src_bit_size(instr->src[i].src) == 64 &&
|
||||
!(src.src.is_ssa && src.src.ssa->parent_instr->type == nir_instr_type_ssa_undef)) {
|
||||
!(src.src.is_ssa && src.src.ssa->parent_instr->type == nir_instr_type_undef)) {
|
||||
int chan1 = 1;
|
||||
if (nir_op_infos[instr->op].input_sizes[i] == 0) {
|
||||
chan1 = instr->def.num_components > 1 ? 1 : 0;
|
||||
@@ -2941,8 +2941,8 @@ ntt_emit_instr(struct ntt_compile *c, nir_instr *instr)
|
||||
ntt_emit_jump(c, nir_instr_as_jump(instr));
|
||||
break;
|
||||
|
||||
case nir_instr_type_ssa_undef:
|
||||
ntt_emit_ssa_undef(c, nir_instr_as_ssa_undef(instr));
|
||||
case nir_instr_type_undef:
|
||||
ntt_emit_ssa_undef(c, nir_instr_as_undef(instr));
|
||||
break;
|
||||
|
||||
default:
|
||||
|
@@ -399,7 +399,7 @@ get_src(struct etna_compile *c, nir_src *src)
|
||||
case nir_instr_type_alu:
|
||||
case nir_instr_type_tex:
|
||||
return ra_src(c, src);
|
||||
case nir_instr_type_ssa_undef: {
|
||||
case nir_instr_type_undef: {
|
||||
/* return zero to deal with broken Blur demo */
|
||||
nir_const_value value = CONST(0);
|
||||
return src_swizzle(const_src(c, &value, 1), SWIZZLE(X,X,X,X));
|
||||
@@ -634,7 +634,7 @@ emit_instr(struct etna_compile *c, nir_instr * instr)
|
||||
assert(nir_instr_is_last(instr));
|
||||
break;
|
||||
case nir_instr_type_load_const:
|
||||
case nir_instr_type_ssa_undef:
|
||||
case nir_instr_type_undef:
|
||||
case nir_instr_type_deref:
|
||||
break;
|
||||
default:
|
||||
|
@@ -79,7 +79,7 @@ set_src_live(nir_src *src, void *void_state)
|
||||
|
||||
switch (instr->type) {
|
||||
case nir_instr_type_load_const:
|
||||
case nir_instr_type_ssa_undef:
|
||||
case nir_instr_type_undef:
|
||||
return true;
|
||||
case nir_instr_type_alu: {
|
||||
/* alu op bypass */
|
||||
|
@@ -851,8 +851,8 @@ emit_instr(struct ir2_context *ctx, nir_instr *instr)
|
||||
case nir_instr_type_jump:
|
||||
ctx->block_has_jump[ctx->block_idx] = true;
|
||||
break;
|
||||
case nir_instr_type_ssa_undef:
|
||||
emit_undef(ctx, nir_instr_as_ssa_undef(instr));
|
||||
case nir_instr_type_undef:
|
||||
emit_undef(ctx, nir_instr_as_undef(instr));
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
|
@@ -324,7 +324,7 @@ static bool (*gpir_emit_instr[nir_instr_type_phi])(gpir_block *, nir_instr *) =
|
||||
[nir_instr_type_alu] = gpir_emit_alu,
|
||||
[nir_instr_type_intrinsic] = gpir_emit_intrinsic,
|
||||
[nir_instr_type_load_const] = gpir_emit_load_const,
|
||||
[nir_instr_type_ssa_undef] = gpir_emit_ssa_undef,
|
||||
[nir_instr_type_undef] = gpir_emit_ssa_undef,
|
||||
[nir_instr_type_tex] = gpir_emit_tex,
|
||||
[nir_instr_type_jump] = gpir_emit_jump,
|
||||
};
|
||||
|
@@ -471,7 +471,7 @@ static bool ppir_emit_load_const(ppir_block *block, nir_instr *ni)
|
||||
|
||||
static bool ppir_emit_ssa_undef(ppir_block *block, nir_instr *ni)
|
||||
{
|
||||
nir_undef_instr *undef = nir_instr_as_ssa_undef(ni);
|
||||
nir_undef_instr *undef = nir_instr_as_undef(ni);
|
||||
ppir_node *node = ppir_node_create_ssa(block, ppir_op_undef, &undef->def);
|
||||
if (!node)
|
||||
return false;
|
||||
@@ -665,7 +665,7 @@ static bool (*ppir_emit_instr[nir_instr_type_phi])(ppir_block *, nir_instr *) =
|
||||
[nir_instr_type_alu] = ppir_emit_alu,
|
||||
[nir_instr_type_intrinsic] = ppir_emit_intrinsic,
|
||||
[nir_instr_type_load_const] = ppir_emit_load_const,
|
||||
[nir_instr_type_ssa_undef] = ppir_emit_ssa_undef,
|
||||
[nir_instr_type_undef] = ppir_emit_ssa_undef,
|
||||
[nir_instr_type_tex] = ppir_emit_tex,
|
||||
[nir_instr_type_jump] = ppir_emit_jump,
|
||||
};
|
||||
|
@@ -127,8 +127,8 @@ InstrFactory::from_nir(nir_instr *instr, Shader& shader)
|
||||
return TexInstr::from_nir(nir_instr_as_tex(instr), shader);
|
||||
case nir_instr_type_jump:
|
||||
return process_jump(nir_instr_as_jump(instr), shader);
|
||||
case nir_instr_type_ssa_undef:
|
||||
return process_undef(nir_instr_as_ssa_undef(instr), shader);
|
||||
case nir_instr_type_undef:
|
||||
return process_undef(nir_instr_as_undef(instr), shader);
|
||||
default:
|
||||
fprintf(stderr, "Instruction type %d not supported\n", instr->type);
|
||||
return false;
|
||||
|
@@ -860,8 +860,8 @@ Lower64BitToVec2::filter(const nir_instr *instr) const
|
||||
auto lc = nir_instr_as_load_const(instr);
|
||||
return lc->def.bit_size == 64;
|
||||
}
|
||||
case nir_instr_type_ssa_undef: {
|
||||
auto undef = nir_instr_as_ssa_undef(instr);
|
||||
case nir_instr_type_undef: {
|
||||
auto undef = nir_instr_as_undef(instr);
|
||||
return undef->def.bit_size == 64;
|
||||
}
|
||||
default:
|
||||
@@ -934,8 +934,8 @@ Lower64BitToVec2::lower(nir_instr *instr)
|
||||
|
||||
return nir_build_imm(b, 2 * lc->def.num_components, 32, val);
|
||||
}
|
||||
case nir_instr_type_ssa_undef: {
|
||||
auto undef = nir_instr_as_ssa_undef(instr);
|
||||
case nir_instr_type_undef: {
|
||||
auto undef = nir_instr_as_undef(instr);
|
||||
undef->def.num_components *= 2;
|
||||
undef->def.bit_size = 32;
|
||||
return NIR_LOWER_INSTR_PROGRESS;
|
||||
|
@@ -2008,8 +2008,8 @@ ntq_emit_instr(struct vc4_compile *c, nir_instr *instr)
|
||||
ntq_emit_load_const(c, nir_instr_as_load_const(instr));
|
||||
break;
|
||||
|
||||
case nir_instr_type_ssa_undef:
|
||||
ntq_emit_ssa_undef(c, nir_instr_as_ssa_undef(instr));
|
||||
case nir_instr_type_undef:
|
||||
ntq_emit_ssa_undef(c, nir_instr_as_undef(instr));
|
||||
break;
|
||||
|
||||
case nir_instr_type_tex:
|
||||
|
@@ -3998,8 +3998,8 @@ emit_block(struct ntv_context *ctx, struct nir_block *block)
|
||||
case nir_instr_type_load_const:
|
||||
emit_load_const(ctx, nir_instr_as_load_const(instr));
|
||||
break;
|
||||
case nir_instr_type_ssa_undef:
|
||||
emit_undef(ctx, nir_instr_as_ssa_undef(instr));
|
||||
case nir_instr_type_undef:
|
||||
emit_undef(ctx, nir_instr_as_undef(instr));
|
||||
break;
|
||||
case nir_instr_type_tex:
|
||||
emit_tex(ctx, nir_instr_as_tex(instr));
|
||||
|
@@ -472,7 +472,7 @@ fs_visitor::nir_emit_instr(nir_instr *instr)
|
||||
nir_emit_load_const(abld, nir_instr_as_load_const(instr));
|
||||
break;
|
||||
|
||||
case nir_instr_type_ssa_undef:
|
||||
case nir_instr_type_undef:
|
||||
/* We create a new VGRF for undefs on every use (by handling
|
||||
* them in get_nir_src()), rather than for each definition.
|
||||
* This helps register coalescing eliminate MOVs from undef.
|
||||
|
@@ -154,8 +154,8 @@ vec4_visitor::nir_emit_instr(nir_instr *instr)
|
||||
nir_emit_texture(nir_instr_as_tex(instr));
|
||||
break;
|
||||
|
||||
case nir_instr_type_ssa_undef:
|
||||
nir_emit_undef(nir_instr_as_ssa_undef(instr));
|
||||
case nir_instr_type_undef:
|
||||
nir_emit_undef(nir_instr_as_undef(instr));
|
||||
break;
|
||||
|
||||
default:
|
||||
|
@@ -5651,8 +5651,8 @@ static bool emit_instr(struct ntd_context *ctx, struct nir_instr* instr)
|
||||
return emit_phi(ctx, nir_instr_as_phi(instr));
|
||||
case nir_instr_type_tex:
|
||||
return emit_tex(ctx, nir_instr_as_tex(instr));
|
||||
case nir_instr_type_ssa_undef:
|
||||
return emit_undefined(ctx, nir_instr_as_ssa_undef(instr));
|
||||
case nir_instr_type_undef:
|
||||
return emit_undefined(ctx, nir_instr_as_undef(instr));
|
||||
default:
|
||||
log_nir_instr_unsupported(ctx->logger, "Unimplemented instruction type",
|
||||
instr);
|
||||
|
@@ -1527,8 +1527,8 @@ Converter::visit(nir_instr *insn)
|
||||
return visit(nir_instr_as_jump(insn));
|
||||
case nir_instr_type_load_const:
|
||||
return visit(nir_instr_as_load_const(insn));
|
||||
case nir_instr_type_ssa_undef:
|
||||
return visit(nir_instr_as_ssa_undef(insn));
|
||||
case nir_instr_type_undef:
|
||||
return visit(nir_instr_as_undef(insn));
|
||||
case nir_instr_type_tex:
|
||||
return visit(nir_instr_as_tex(insn));
|
||||
default:
|
||||
|
@@ -2299,7 +2299,7 @@ emit_instr(compiler_context *ctx, struct nir_instr *instr)
|
||||
emit_jump(ctx, nir_instr_as_jump(instr));
|
||||
break;
|
||||
|
||||
case nir_instr_type_ssa_undef:
|
||||
case nir_instr_type_undef:
|
||||
/* Spurious */
|
||||
break;
|
||||
|
||||
|
Reference in New Issue
Block a user