aboutsummaryrefslogtreecommitdiffstats
path: root/src/gallium/drivers/lima/ir
diff options
context:
space:
mode:
authorVasily Khoruzhick <[email protected]>2020-01-25 13:31:53 -0800
committerMarge Bot <[email protected]>2020-01-28 01:45:29 +0000
commit650c68054536ceefb8d085e343b82f907127a56d (patch)
tree2cf2418fe6a4a367a7ce0c8e1a6c3dce2d685511 /src/gallium/drivers/lima/ir
parent4a0f62f1fcab5350d6173c843fd95089953431a0 (diff)
lima: ppir: always create move and update ld_tex successors for all blocks
Always create a mov for ld_tex since we can't rely on ppir_node_has_single_src_succ() if we have multiple blocks. And since ld_tex successor can be in a different block we have to update their ppir_src as well. Reviewed-by: Erico Nunes <[email protected]> Signed-off-by: Vasily Khoruzhick <[email protected]> Tested-by: Marge Bot <https://gitlab.freedesktop.org/mesa/mesa/merge_requests/3564> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/merge_requests/3564>
Diffstat (limited to 'src/gallium/drivers/lima/ir')
-rw-r--r--src/gallium/drivers/lima/ir/pp/lower.c25
-rw-r--r--src/gallium/drivers/lima/ir/pp/node.c21
-rw-r--r--src/gallium/drivers/lima/ir/pp/ppir.h1
3 files changed, 24 insertions, 23 deletions
diff --git a/src/gallium/drivers/lima/ir/pp/lower.c b/src/gallium/drivers/lima/ir/pp/lower.c
index 034425c97a7..f7c61df2b0a 100644
--- a/src/gallium/drivers/lima/ir/pp/lower.c
+++ b/src/gallium/drivers/lima/ir/pp/lower.c
@@ -185,29 +185,8 @@ static bool ppir_lower_texture(ppir_block *block, ppir_node *node)
load_tex->src[0].type = load->dest.type = ppir_target_pipeline;
load_tex->src[0].pipeline = load->dest.pipeline = ppir_pipeline_reg_discard;
- if (ppir_node_has_single_src_succ(node)) {
- ppir_node *succ = ppir_node_first_succ(node);
- switch (succ->type) {
- case ppir_node_type_alu:
- case ppir_node_type_branch: {
- for (int i = 0; i < ppir_node_get_src_num(succ); i++) {
- ppir_src *src = ppir_node_get_src(succ, i);
- if (src->node == node) {
- /* Can consume samplers directly */
- src->type = dest->type = ppir_target_pipeline;
- src->pipeline = dest->pipeline = ppir_pipeline_reg_sampler;
- }
- }
- return true;
- }
- default:
- /* Create mov for everyone else */
- break;
- }
- }
-
- /* Create move node */
- ppir_node *move = ppir_node_insert_mov(node);
+ /* Always create move node since there can be successors in other blocks */
+ ppir_node *move = ppir_node_insert_mov_all_blocks(node);
if (unlikely(!move))
return false;
diff --git a/src/gallium/drivers/lima/ir/pp/node.c b/src/gallium/drivers/lima/ir/pp/node.c
index e646a395ca7..1a822b89032 100644
--- a/src/gallium/drivers/lima/ir/pp/node.c
+++ b/src/gallium/drivers/lima/ir/pp/node.c
@@ -732,6 +732,27 @@ ppir_node *ppir_node_insert_mov(ppir_node *node)
return move;
}
+ppir_node *ppir_node_insert_mov_all_blocks(ppir_node *old)
+{
+ ppir_node *move = ppir_node_insert_mov(old);
+ ppir_compiler *comp = old->block->comp;
+
+ list_for_each_entry(ppir_block, block, &comp->block_list, list) {
+ if (old->block == block)
+ continue;
+ list_for_each_entry_safe(ppir_node, node, &block->node_list, list) {
+ for (int i = 0; i < ppir_node_get_src_num(node); i++){
+ ppir_src *src = ppir_node_get_src(node, i);
+ if (!src)
+ continue;
+ if (src->node == old)
+ ppir_node_target_assign(src, move);
+ }
+ }
+ }
+
+ return move;
+}
bool ppir_node_has_single_src_succ(ppir_node *node)
{
if (list_is_singular(&node->succ_list) &&
diff --git a/src/gallium/drivers/lima/ir/pp/ppir.h b/src/gallium/drivers/lima/ir/pp/ppir.h
index 2b4629bcaab..357fcada8b7 100644
--- a/src/gallium/drivers/lima/ir/pp/ppir.h
+++ b/src/gallium/drivers/lima/ir/pp/ppir.h
@@ -412,6 +412,7 @@ 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);
static inline bool ppir_node_is_root(ppir_node *node)
{