From: Vasily Khoruzhick Date: Mon, 19 Aug 2019 05:51:34 +0000 (-0700) Subject: lima/ppir: fix ordering deps X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=cd8c569ced321a80f6a45522c270e1db154481b3;p=mesa.git lima/ppir: fix ordering deps There can be several root nodes, i.e.: (1) r0 = r1 (2) r2 = r3 (3) branch if (ssa1) We need to make (3) depend on (1) and (2), old code added dependency only for (2), and (1) was kept as root node since there is no branch/discard or store color between two movs. Tested-by: Andreas Baierl Reviewed-by: Qiang Yu Reviewed-by: Erico Nunes Signed-off-by: Vasily Khoruzhick --- diff --git a/src/gallium/drivers/lima/ir/pp/nir.c b/src/gallium/drivers/lima/ir/pp/nir.c index d1a8bc140b6..f7eaccd7c63 100644 --- a/src/gallium/drivers/lima/ir/pp/nir.c +++ b/src/gallium/drivers/lima/ir/pp/nir.c @@ -576,12 +576,14 @@ static void ppir_add_ordering_deps(ppir_compiler *comp) */ list_for_each_entry(ppir_block, block, &comp->block_list, list) { ppir_node *prev_node = NULL; - list_for_each_entry(ppir_node, node, &block->node_list, list) { - if (node->type == ppir_node_type_discard || - node->type == ppir_node_type_store || - node->type == ppir_node_type_branch) { - if (prev_node) - ppir_node_add_dep(node, prev_node); + list_for_each_entry_rev(ppir_node, node, &block->node_list, list) { + if (prev_node && ppir_node_is_root(node) && node->op != ppir_op_const) { + ppir_node_add_dep(prev_node, node); + } + if (node->op == ppir_op_discard || + node->op == ppir_op_store_color || + node->op == ppir_op_store_temp || + node->op == ppir_op_branch) { prev_node = node; } }