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:
@@ -28,7 +28,7 @@
|
||||
#include "nir_builder.h"
|
||||
#include "nir_deref.h"
|
||||
|
||||
static nir_ssa_def *
|
||||
static nir_def *
|
||||
get_io_index(nir_builder *b, nir_deref_instr *deref)
|
||||
{
|
||||
nir_deref_path path;
|
||||
@@ -38,13 +38,13 @@ get_io_index(nir_builder *b, nir_deref_instr *deref)
|
||||
nir_deref_instr **p = &path.path[1];
|
||||
|
||||
/* Just emit code and let constant-folding go to town */
|
||||
nir_ssa_def *offset = nir_imm_int(b, 0);
|
||||
nir_def *offset = nir_imm_int(b, 0);
|
||||
|
||||
for (; *p; p++) {
|
||||
if ((*p)->deref_type == nir_deref_type_array) {
|
||||
unsigned size = glsl_get_length((*p)->type);
|
||||
|
||||
nir_ssa_def *mul =
|
||||
nir_def *mul =
|
||||
nir_amul_imm(b, nir_ssa_for_src(b, (*p)->arr.index, 1), size);
|
||||
|
||||
offset = nir_iadd(b, offset, mul);
|
||||
@@ -65,7 +65,7 @@ nir_lower_texcoord_replace_impl(nir_function_impl *impl,
|
||||
{
|
||||
nir_builder b = nir_builder_at(nir_before_cf_list(&impl->body));
|
||||
|
||||
nir_ssa_def *new_coord;
|
||||
nir_def *new_coord;
|
||||
if (point_coord_is_sysval) {
|
||||
new_coord = nir_load_system_value(&b, nir_intrinsic_load_point_coord,
|
||||
0, 2, 32);
|
||||
@@ -81,9 +81,9 @@ nir_lower_texcoord_replace_impl(nir_function_impl *impl,
|
||||
/* point-coord is two-component, need to add two implicit ones in case of
|
||||
* projective texturing etc.
|
||||
*/
|
||||
nir_ssa_def *zero = nir_imm_zero(&b, 1, new_coord->bit_size);
|
||||
nir_ssa_def *one = nir_imm_floatN_t(&b, 1.0, new_coord->bit_size);
|
||||
nir_ssa_def *y = nir_channel(&b, new_coord, 1);
|
||||
nir_def *zero = nir_imm_zero(&b, 1, new_coord->bit_size);
|
||||
nir_def *one = nir_imm_floatN_t(&b, 1.0, new_coord->bit_size);
|
||||
nir_def *y = nir_channel(&b, new_coord, 1);
|
||||
if (yinvert)
|
||||
y = nir_fsub_imm(&b, 1.0, y);
|
||||
new_coord = nir_vec4(&b, nir_channel(&b, new_coord, 0),
|
||||
@@ -108,18 +108,18 @@ nir_lower_texcoord_replace_impl(nir_function_impl *impl,
|
||||
|
||||
b.cursor = nir_after_instr(instr);
|
||||
nir_deref_instr *deref = nir_src_as_deref(intrin->src[0]);
|
||||
nir_ssa_def *index = get_io_index(&b, deref);
|
||||
nir_ssa_def *mask =
|
||||
nir_def *index = get_io_index(&b, deref);
|
||||
nir_def *mask =
|
||||
nir_ishl(&b, nir_imm_int(&b, 1),
|
||||
nir_iadd_imm(&b, index, base));
|
||||
|
||||
nir_ssa_def *cond = nir_test_mask(&b, mask, coord_replace);
|
||||
nir_ssa_def *result = nir_bcsel(&b, cond, new_coord,
|
||||
&intrin->dest.ssa);
|
||||
nir_def *cond = nir_test_mask(&b, mask, coord_replace);
|
||||
nir_def *result = nir_bcsel(&b, cond, new_coord,
|
||||
&intrin->dest.ssa);
|
||||
|
||||
nir_ssa_def_rewrite_uses_after(&intrin->dest.ssa,
|
||||
result,
|
||||
result->parent_instr);
|
||||
nir_def_rewrite_uses_after(&intrin->dest.ssa,
|
||||
result,
|
||||
result->parent_instr);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user