aboutsummaryrefslogtreecommitdiffstats
path: root/src/gallium/drivers/lima/ir
diff options
context:
space:
mode:
authorErico Nunes <[email protected]>2020-04-13 16:04:26 +0200
committerMarge Bot <[email protected]>2020-05-09 11:30:07 +0000
commit6b21b771f7b4bdd60089c784ed35e33622c8932a (patch)
tree04ab4aa33b3d0a73b169e57d30f3f3f09b54c0aa /src/gallium/drivers/lima/ir
parent8c4157138f331d5053036f756aefa7006bbb6fac (diff)
lima/ppir: remove unused clone functions
With the previous refactors moving these lowering steps to a nir pass, these are no longer needed. Signed-off-by: Erico Nunes <[email protected]> Reviewed-by: Vasily Khoruzhick <[email protected]> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/4535>
Diffstat (limited to 'src/gallium/drivers/lima/ir')
-rw-r--r--src/gallium/drivers/lima/ir/pp/node.c97
-rw-r--r--src/gallium/drivers/lima/ir/pp/ppir.h2
2 files changed, 0 insertions, 99 deletions
diff --git a/src/gallium/drivers/lima/ir/pp/node.c b/src/gallium/drivers/lima/ir/pp/node.c
index 1a822b89032..fdf444af0bb 100644
--- a/src/gallium/drivers/lima/ir/pp/node.c
+++ b/src/gallium/drivers/lima/ir/pp/node.c
@@ -613,103 +613,6 @@ void ppir_node_print_prog(ppir_compiler *comp)
printf("====================\n");
}
-static ppir_node *ppir_node_clone_const(ppir_block *block, ppir_node *node)
-{
- ppir_const_node *cnode = ppir_node_to_const(node);
- ppir_const_node *new_cnode = ppir_node_create(block, ppir_op_const, -1, 0);
-
- if (!new_cnode)
- return NULL;
-
- list_addtail(&new_cnode->node.list, &block->node_list);
-
- new_cnode->constant.num = cnode->constant.num;
- for (int i = 0; i < cnode->constant.num; i++) {
- new_cnode->constant.value[i] = cnode->constant.value[i];
- }
- new_cnode->dest.type = ppir_target_ssa;
- new_cnode->dest.ssa.num_components = cnode->dest.ssa.num_components;
- new_cnode->dest.write_mask = cnode->dest.write_mask;
-
- return &new_cnode->node;
-}
-
-static ppir_node *
-ppir_node_clone_load(ppir_block *block, ppir_node *node)
-{
- ppir_load_node *load_node = ppir_node_to_load(node);
- ppir_load_node *new_lnode = ppir_node_create(block, node->op, -1, 0);
-
- if (!new_lnode)
- return NULL;
-
- list_addtail(&new_lnode->node.list, &block->node_list);
-
- new_lnode->num_components = load_node->num_components;
- new_lnode->index = load_node->index;
-
- ppir_dest *dest = ppir_node_get_dest(node);
- new_lnode->dest = *dest;
-
- ppir_src *src = ppir_node_get_src(node, 0);
- if (src) {
- new_lnode->num_src = 1;
- switch (src->type) {
- case ppir_target_ssa:
- ppir_node_target_assign(&new_lnode->src, src->node);
- ppir_node_add_dep(&new_lnode->node, src->node, ppir_dep_src);
- break;
- case ppir_target_register:
- new_lnode->src.type = src->type;
- new_lnode->src.reg = src->reg;
- new_lnode->src.node = NULL;
- break;
- default:
- /* Load nodes can't consume pipeline registers */
- assert(0);
- }
- }
-
- return &new_lnode->node;
-}
-
-void
-ppir_delete_if_orphan(ppir_block *block, ppir_node *node)
-{
- ppir_dest *dest = ppir_node_get_dest(node);
- if (!dest)
- return;
-
- ppir_node_foreach_succ_safe(node, dep) {
- ppir_node *succ = dep->succ;
- for (int i = 0; i < ppir_node_get_src_num(succ); i++) {
- ppir_src *src = ppir_node_get_src(succ, i);
- if (!src)
- continue;
- if (ppir_node_target_equal(src, dest))
- return;
- }
- }
-
- ppir_node_delete(node);
-}
-
-ppir_node *ppir_node_clone(ppir_block *block, ppir_node *node)
-{
- switch (node->op) {
- case ppir_op_const:
- return ppir_node_clone_const(block, node);
- case ppir_op_load_uniform:
- case ppir_op_load_varying:
- case ppir_op_load_temp:
- case ppir_op_load_coords:
- case ppir_op_load_coords_reg:
- return ppir_node_clone_load(block, node);
- default:
- return NULL;
- }
-}
-
ppir_node *ppir_node_insert_mov(ppir_node *node)
{
ppir_node *move = ppir_node_create(node->block, ppir_op_mov, -1, 0);
diff --git a/src/gallium/drivers/lima/ir/pp/ppir.h b/src/gallium/drivers/lima/ir/pp/ppir.h
index dc76bfdc38a..cec918d50f3 100644
--- a/src/gallium/drivers/lima/ir/pp/ppir.h
+++ b/src/gallium/drivers/lima/ir/pp/ppir.h
@@ -411,9 +411,7 @@ void ppir_node_print_prog(ppir_compiler *comp);
void ppir_node_replace_child(ppir_node *parent, ppir_node *old_child, ppir_node *new_child);
void ppir_node_replace_all_succ(ppir_node *dst, ppir_node *src);
void ppir_node_replace_pred(ppir_dep *dep, ppir_node *new_pred);
-void ppir_delete_if_orphan(ppir_block *block, ppir_node *node);
ppir_dep *ppir_dep_for_pred(ppir_node *node, ppir_node *pred);
-ppir_node *ppir_node_clone(ppir_block *block, ppir_node *node);
/* Assumes that node successors are in the same block */
ppir_node *ppir_node_insert_mov(ppir_node *node);
ppir_node *ppir_node_insert_mov_all_blocks(ppir_node *node);