aboutsummaryrefslogtreecommitdiffstats
path: root/src/gallium/drivers/lima
diff options
context:
space:
mode:
authorVasily Khoruzhick <[email protected]>2019-08-18 22:51:34 -0700
committerVasily Khoruzhick <[email protected]>2019-08-23 18:19:47 -0700
commitcd8c569ced321a80f6a45522c270e1db154481b3 (patch)
tree65be3a74d25b0076f560c9d4fd28756b9ee20556 /src/gallium/drivers/lima
parentbf2872eeb2d60d9eb0466728beb64cfee507654e (diff)
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 <[email protected]> Reviewed-by: Qiang Yu <[email protected]> Reviewed-by: Erico Nunes <[email protected]> Signed-off-by: Vasily Khoruzhick <[email protected]>
Diffstat (limited to 'src/gallium/drivers/lima')
-rw-r--r--src/gallium/drivers/lima/ir/pp/nir.c14
1 files changed, 8 insertions, 6 deletions
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;
}
}