From 9e714f7455d581bf20ec7a72ee84ab4e381c08a9 Mon Sep 17 00:00:00 2001 From: Icecream95 Date: Mon, 14 Feb 2022 16:20:47 +1300 Subject: [PATCH] pan/bi: Add interference between destinations Trying to write to overlapping register ranges from a single instruction is undefined behaviour, so add interference between the nodes to avoid this. Hit in a dual-texture instruction in LIMBO. Fixes: 9146bafbb42 ("pan/bi: Add dual texture fusing pass") Part-of: --- src/panfrost/bifrost/bi_ra.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/panfrost/bifrost/bi_ra.c b/src/panfrost/bifrost/bi_ra.c index 689b0c1..604f361 100644 --- a/src/panfrost/bifrost/bi_ra.c +++ b/src/panfrost/bifrost/bi_ra.c @@ -246,6 +246,12 @@ bi_mark_interference(bi_block *block, struct lcra_state *l, uint8_t *live, uint6 bi_writemask(ins, d), i, live[i]); } } + + unsigned node_first = bi_get_node(ins->dest[0]); + if (d == 1 && node_first < node_count) { + lcra_add_node_interference(l, node, bi_writemask(ins, 1), + node_first, bi_writemask(ins, 0)); + } } /* Valhall needs >= 64-bit staging reads to be pair-aligned */ -- 2.7.4