nir: Drop "SSA" from NIR language
Everything is SSA now.
sed -e 's/nir_ssa_def/nir_def/g' \
-e 's/nir_ssa_undef/nir_undef/g' \
-e 's/nir_ssa_scalar/nir_scalar/g' \
-e 's/nir_src_rewrite_ssa/nir_src_rewrite/g' \
-e 's/nir_gather_ssa_types/nir_gather_types/g' \
-i $(git grep -l nir | grep -v relnotes)
git mv src/compiler/nir/nir_gather_ssa_types.c \
src/compiler/nir/nir_gather_types.c
ninja -C build/ clang-format
cd src/compiler/nir && find *.c *.h -type f -exec clang-format -i \{} \;
Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Acked-by: Faith Ekstrand <faith.ekstrand@collabora.com>
Acked-by: Emma Anholt <emma@anholt.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24585>
This commit is contained in:
@@ -26,24 +26,24 @@
|
||||
|
||||
static void
|
||||
build_write_masked_store(nir_builder *b, nir_deref_instr *vec_deref,
|
||||
nir_ssa_def *value, unsigned component)
|
||||
nir_def *value, unsigned component)
|
||||
{
|
||||
assert(value->num_components == 1);
|
||||
unsigned num_components = glsl_get_components(vec_deref->type);
|
||||
assert(num_components > 1 && num_components <= NIR_MAX_VEC_COMPONENTS);
|
||||
|
||||
nir_ssa_def *u = nir_ssa_undef(b, 1, value->bit_size);
|
||||
nir_ssa_def *comps[NIR_MAX_VEC_COMPONENTS];
|
||||
nir_def *u = nir_undef(b, 1, value->bit_size);
|
||||
nir_def *comps[NIR_MAX_VEC_COMPONENTS];
|
||||
for (unsigned i = 0; i < num_components; i++)
|
||||
comps[i] = (i == component) ? value : u;
|
||||
|
||||
nir_ssa_def *vec = nir_vec(b, comps, num_components);
|
||||
nir_def *vec = nir_vec(b, comps, num_components);
|
||||
nir_store_deref(b, vec_deref, vec, (1u << component));
|
||||
}
|
||||
|
||||
static void
|
||||
build_write_masked_stores(nir_builder *b, nir_deref_instr *vec_deref,
|
||||
nir_ssa_def *value, nir_ssa_def *index,
|
||||
nir_def *value, nir_def *index,
|
||||
unsigned start, unsigned end)
|
||||
{
|
||||
if (start == end - 1) {
|
||||
@@ -106,7 +106,7 @@ nir_lower_array_deref_of_vec_impl(nir_function_impl *impl,
|
||||
b.cursor = nir_after_instr(&intrin->instr);
|
||||
|
||||
if (intrin->intrinsic == nir_intrinsic_store_deref) {
|
||||
nir_ssa_def *value = intrin->src[1].ssa;
|
||||
nir_def *value = intrin->src[1].ssa;
|
||||
|
||||
if (nir_src_is_const(deref->arr.index)) {
|
||||
if (!(options & nir_lower_direct_array_deref_of_vec_store))
|
||||
@@ -122,7 +122,7 @@ nir_lower_array_deref_of_vec_impl(nir_function_impl *impl,
|
||||
if (!(options & nir_lower_indirect_array_deref_of_vec_store))
|
||||
continue;
|
||||
|
||||
nir_ssa_def *index = nir_ssa_for_src(&b, deref->arr.index, 1);
|
||||
nir_def *index = nir_ssa_for_src(&b, deref->arr.index, 1);
|
||||
build_write_masked_stores(&b, vec_deref, value, index,
|
||||
0, num_components);
|
||||
}
|
||||
@@ -144,17 +144,17 @@ nir_lower_array_deref_of_vec_impl(nir_function_impl *impl,
|
||||
intrin->dest.ssa.num_components = num_components;
|
||||
intrin->num_components = num_components;
|
||||
|
||||
nir_ssa_def *index = nir_ssa_for_src(&b, deref->arr.index, 1);
|
||||
nir_ssa_def *scalar =
|
||||
nir_def *index = nir_ssa_for_src(&b, deref->arr.index, 1);
|
||||
nir_def *scalar =
|
||||
nir_vector_extract(&b, &intrin->dest.ssa, index);
|
||||
if (scalar->parent_instr->type == nir_instr_type_ssa_undef) {
|
||||
nir_ssa_def_rewrite_uses(&intrin->dest.ssa,
|
||||
scalar);
|
||||
nir_def_rewrite_uses(&intrin->dest.ssa,
|
||||
scalar);
|
||||
nir_instr_remove(&intrin->instr);
|
||||
} else {
|
||||
nir_ssa_def_rewrite_uses_after(&intrin->dest.ssa,
|
||||
scalar,
|
||||
scalar->parent_instr);
|
||||
nir_def_rewrite_uses_after(&intrin->dest.ssa,
|
||||
scalar,
|
||||
scalar->parent_instr);
|
||||
}
|
||||
progress = true;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user